Skip to content
Browse files

Small fix for Mappings

  • Loading branch information...
1 parent 01b37d7 commit b911b63d71bda609ef20aac91f34e7bd8c911d7d @golovanov committed
View
2 Command/InfoDoctrineOXMCommand.php
@@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'You do not have any mapped Doctrine OXM xml-entities for any of your bundles. '.
'Create a class inside the XmlEntity namespace of any of your bundles and provide '.
'mapping information for it with Annotations directly in the classes doc blocks '.
- 'or with XML/YAML in your bundles Resources/config/doctrine/metadata/mongodb directory.'
+ 'or with XML/YAML in your bundles Resources/config/doctrine/ directory.'
);
}
View
12 DependencyInjection/DoctrineOXMExtension.php
@@ -116,7 +116,7 @@ protected function loadXmlEntityManager(array $xmlEntityManager, $defaultXEM, $d
'setProxyDir' => '%doctrine.oxm.proxy_dir%',
'setProxyNamespace' => '%doctrine.oxm.proxy_namespace%',
'setAutoGenerateProxyClasses' => '%doctrine.oxm.auto_generate_proxy_classes%',
- 'setDefaultStorage' => $defaultStorage,
+ // 'setDefaultStorage' => $defaultStorage,
);
// if ($xmlEntityManager['logging']) {
@@ -147,7 +147,7 @@ protected function loadXmlEntityManager(array $xmlEntityManager, $defaultXEM, $d
);
$oxmXemDef = new Definition('%doctrine.oxm.xml_entity_manager.class%', $oxmXemArgs);
$oxmXemDef->setFactoryClass('%doctrine.oxm.xml_entity_manager.class%');
- $oxmXemDef->setFactoryMethod('create');
+ // $oxmXemDef->setFactoryMethod('create');
$oxmXemDef->addTag('doctrine.oxm.xml_entity_manager');
$container->setDefinition(sprintf('doctrine.oxm.%s_xml_entity_manager', $xmlEntityManager['name']), $oxmXemDef);
@@ -255,17 +255,17 @@ protected function loadXmlEntityManagerBundlesMappingInformation(array $xmlEntit
$this->loadMappingInformation($xmlEntityManager, $container);
$this->registerMappingDrivers($xmlEntityManager, $container);
- if ($oxmConfigDef->hasMethodCall('setXmlEntityNamespaces')) {
+ if ($oxmConfigDef->hasMethodCall('setEntityNamespaces')) {
// TODO: Can we make a method out of it on Definition? replaceMethodArguments() or something.
$calls = $oxmConfigDef->getMethodCalls();
foreach ($calls as $call) {
- if ($call[0] == 'setXmlEntityNamespaces') {
+ if ($call[0] == 'setEntityNamespaces') {
$this->aliasMap = array_merge($call[1][0], $this->aliasMap);
}
}
- $method = $oxmConfigDef->removeMethodCall('setXmlEntityNamespaces');
+ $method = $oxmConfigDef->removeMethodCall('setEntityNamespaces');
}
- $oxmConfigDef->addMethodCall('setXmlEntityNamespaces', array($this->aliasMap));
+ $oxmConfigDef->addMethodCall('setEntityNamespaces', array($this->aliasMap));
}
View
8 DoctrineOXMBundle.php
@@ -6,6 +6,8 @@
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Doctrine\Bundle\OXMBundle\DependencyInjection\Compiler\EventManagerPass;
+use Doctrine\Bundle\OXMBundle\DependencyInjection\Compiler\CreateProxyDirectoryPass;
+use Doctrine\Bundle\OXMBundle\DependencyInjection\DoctrineOXMExtension;
/**
* Doctrine OXM bundle.
@@ -17,5 +19,11 @@ class DoctrineOXMBundle extends Bundle
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new EventManagerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
+ $container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
+ }
+
+ public function getContainerExtension()
+ {
+ return new DoctrineOXMExtension();
}
}
View
6 Mapping/Driver/XmlDriver.php
@@ -53,7 +53,7 @@ public function getAllClassNames()
if ($this->paths) {
foreach ((array) $this->paths as $path) {
if (!is_dir($path)) {
- throw MongoDBException::fileMappingDriversRequireConfiguredDirectoryPath();
+ throw OXMException::fileMappingDriversRequireConfiguredDirectoryPath();
}
$iterator = new \RecursiveIteratorIterator(
@@ -129,9 +129,9 @@ protected function findMappingFile($className)
return $filename;
}
- throw MongoDBException::mappingNotFound($className, $filename);
+ throw OXMException::mappingNotFound($className, $filename);
}
- throw MongoDBException::mappingNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
+ throw OXMException::mappingNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
}
}

0 comments on commit b911b63

Please sign in to comment.
Something went wrong with that request. Please try again.