Permalink
Browse files

[DoctrineMongoDBBundle] registered new validation namespace for annot…

…ations
  • Loading branch information...
1 parent 1cbd0ca commit 6d52645861118ad122c56158ba9445b332297d05 @avalanche123 avalanche123 committed with fabpot Jan 19, 2011
View
11 src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php
@@ -44,6 +44,7 @@ public function mongodbLoad($config, ContainerBuilder $container)
$this->loadDefaults($config, $container);
$this->loadConnections($config, $container);
$this->loadDocumentManagers($config, $container);
+ $this->loadConstraints($config, $container);
}
/**
@@ -339,6 +340,16 @@ protected function loadDocumentManagerBundlesMappingInformation(array $documentM
$odmConfigDef->addMethodCall('setDocumentNamespaces', array($this->aliasMap));
}
+ protected function loadConstraints($config, ContainerBuilder $container)
+ {
+ if ($container->hasParameter('validator.annotations.namespaces')) {
+ $container->setParameter('validator.annotations.namespaces', array_merge(
+ $container->getParamter('validator.annotations.namespaces'),
+ array('Symfony\Bundle\DoctrineMongoDBBundle\Validator\Constraints\\')
+ ));
+ }
+ }
+
protected function getObjectManagerElementName($name)
{
return 'doctrine.odm.mongodb.' . $name;

0 comments on commit 6d52645

Please sign in to comment.