CodeIgniter Forums
Problem with CI + Doctrine - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Problem with CI + Doctrine (/showthread.php?tid=31525)



Problem with CI + Doctrine - El Forum - 06-22-2010

[eluser]demogar[/eluser]
I'm following this instructions to make it work:

http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/code-igniter-and-doctrine/en#code-igniter-and-doctrine

Everything is ok until I get here:
Code:
$ ./doctrine build-all-reload
build-all-reload - Are you sure you wish to drop your databases? (y/n)
y

It returns:
Code:
build-all-reload - Successfully dropped database named: "test"
build-all-reload - Generated models successfully from YAML schema
build-all-reload - Successfully created database named: "test"
build-all-reload - Created tables successfully
build-all-reload - Data was successfully loaded

Fatal error: Class 'BaseUser' not found in D:\htdocs\doctrine\application\models\User.php on line 14

I will appreciate any support Smile


Problem with CI + Doctrine - El Forum - 06-23-2010

[eluser]Burak Guzel[/eluser]
Looks like the base class file is not being loaded automatically.

You can try commenting out this line, which disables lazy loading:

Code:
Doctrine_Manager::getInstance()->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);

OR, you can add this line:

Code:
spl_autoload_register(array('Doctrine', 'modelsAutoload'));

Right after the other line with the call to spl_autoload_register
That will set autoloading for models.