PiTheNumber
PiTheNumber

Reputation: 23542

Doctrine: Class User does not exist and could not be loaded

I am facing the same problem as descripted in this other question but the solution does not work for me. I am using Doctrine 2.1 with CodeIgniter 2 downloaded as package from wildlyinaccurate. As you can see on the page the ClassLoader is called:

$entitiesClassLoader = new \Doctrine\Common\ClassLoader('models', rtrim(APPPATH, '/'));
$entitiesClassLoader->register();

I made sure the path is right. I even tried setting the full path.

Strange for me is that $user = new models\User(); is working. Calling $this->em->find('User', 8); I get the error User does not exists.

Any thoughts about that?

Upvotes: 0

Views: 2228

Answers (1)

Kees Schepers
Kees Schepers

Reputation: 2248

Just a wild guess but don't you have to call find('models\User', 8) ? Because your User object is properly in the 'models' namespace?

Upvotes: 2

Related Questions