From 4e7ba6d5da15a06e470298c47e3ace1b553ee268 Mon Sep 17 00:00:00 2001 From: devel Date: Sun, 26 Dec 2010 21:57:32 +0300 Subject: [PATCH 1/2] Fixed an issue with the definition description Mongo DB collections. Committer: VlastV --- .../DependencyInjection/DoctrineMongoDBExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php index 093fa7510c6e0..ccc47f784e10d 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php @@ -397,9 +397,9 @@ static protected function detectMetadataDriver($dir, ContainerBuilder $container } $container->addResource(new FileResource($resource)); - if (count(glob($dir.'/Resources/config/doctrine/metadata/mongodb/*.xml'))) { + if (($files = glob($dir.'/Resources/config/doctrine/metadata/mongodb/*.xml')) && count($files)) { return 'xml'; - } elseif (count(glob($dir.'/Resources/config/doctrine/metadata/mongodb/*.yml'))) { + } elseif (($files = glob($dir.'/Resources/config/doctrine/metadata/mongodb/*.yml')) && count($files)) { return 'yml'; } From 78871a2f8d1860f10f6061d65b10348a396c8ddd Mon Sep 17 00:00:00 2001 From: devel Date: Mon, 27 Dec 2010 12:23:37 +0300 Subject: [PATCH 2/2] =?UTF-8?q?CollectionField=20=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D1=82=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20=D0=BD=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=20=D0=BE=D1=82=D1=81?= =?UTF-8?q?=D1=83=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B5=20=D0=B2=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D1=80=D0=B0.=20Committer:=20vlastv=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/Form/CollectionField.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Component/Form/CollectionField.php b/src/Symfony/Component/Form/CollectionField.php index 982fdc11dcf52..cf83e0bb39620 100644 --- a/src/Symfony/Component/Form/CollectionField.php +++ b/src/Symfony/Component/Form/CollectionField.php @@ -59,18 +59,20 @@ protected function configure() public function setData($collection) { - if (!is_array($collection) && !$collection instanceof \Traversable) { - throw new UnexpectedTypeException('The data passed to the CollectionField must be an array or a Traversable'); - } - - foreach ($this as $name => $field) { - if (!$this->getOption('modifiable') || '$$key$$' != $name) { - $this->remove($name); + if (null !== $collection) { + if (!is_array($collection) && !$collection instanceof \Traversable) { + throw new UnexpectedTypeException('The data passed to the CollectionField must be an array or a Traversable'); + } + + foreach ($this as $name => $field) { + if (!$this->getOption('modifiable') || '$$key$$' != $name) { + $this->remove($name); + } + } + + foreach ($collection as $name => $value) { + $this->add($this->newField($name, $name)); } - } - - foreach ($collection as $name => $value) { - $this->add($this->newField($name, $name)); } parent::setData($collection); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy