1
votes

I have a 'vanilla' install of CodeIgniter 2 + Doctrine 2.

My tutorial Entity.User.dcm.yml and Entity.Article.dcm.yml files worked just fine in the CLI, through /php doctrine-cli.php orm:generate-entities models and php doctrine-cli.php orm:generate-proxies No fuss, no problems.

But when I got froggy and decided to make new Project1.User.dcm.yml and Project1.cartdata.dcm.yml I got through the generate-entities okay, but when I ran generate-proxies I got:

Warning: class_parents(): Class Project1\Users does not exist and could not be loaded in /../applicationFolder/libraries/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php on line 40

Warning: array_reverse() expects parameter 1 to be array, boolean given in /../applicationFolder/libraries/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 231

Warning: Invalid argument supplied for foreach() in /../applicationFolder/libraries/Doctrine/ORM/Mapping

I tried tons of tinkering, I tried making the names Entities.Project1.User.dcm.yml and similar, but no luck. If I go back to my tutorial Entities files then it all works fine. I made sure that the fine internals are consistent, as far as I can tell, Project1\User and so on

Am I missing something simple and easy? Or is there some other configuration change required to get doctrine to allow these?

1

1 Answers

1
votes

In Doctrine.php:

// load the entities
    $entityClassLoader = new \Doctrine\Common\ClassLoader('Entities', APPPATH.'models');
    $entityClassLoader->register();
    $entityClassLoader = new \Doctrine\Common\ClassLoader('MyNamespace1', APPPATH.'models');
    $entityClassLoader->register();
    $entityClassLoader = new \Doctrine\Common\ClassLoader('MyNamespace2', APPPATH.'models');
    $entityClassLoader->register();