Doctrine - BaseClassName Not Found

I am trying to establish a doctrine in my project and whenever I call a class like

$dealer = Doctrine_Core::getTable( 'Dealers' ).find(1);

Then I get Fatal Error: Class BaseSchools not found.

I know that these files exist, as I did Doctrine_Core::generateModelsFromDb, and I see them

Somehow my paths to my models / generated folder are not shared with my dealer class.

In my bootstrap.php file, I have:

Doctrine::loadModels( array( WWWROOT_PATH . 'models/generated', WWWROOT_PATH . 'models') );

I do not get any errors if I change the path to the wrong path, it throws an error, so I assume that I am doing it right.

In any case, any thoughts will be appreciated.

+3
source share
1 answer

In the end, it turned out that I did not include this line in the boostrap file:

spl_autoload_register( array('Doctrine', 'autoload' ) );
+1
source

Source: https://habr.com/ru/post/1730583/


All Articles