Question

Originally I had my entity classes (PHP with annotations for Doctrine) in the models folder of my CodeIgniter setup. I decided this wasn't such a great idea so I moved all of my entities into an "Entities" folder and updated my Doctrine.php file accordingly...but now when I try to run really anything with the Doctrine CLI I get this error:

PHP Warning:  require([application path withheld]/application/models/Entities/grocery_CRUD_Model.php): failed to open stream: No such file or directory in [application path withheld]/application/libraries/Doctrine/Common/ClassLoader.php on line 163
PHP Fatal error:  require(): Failed opening required '[application path withheld]/application/models/Entities/grocery_CRUD_Model.php' (include_path='.:/usr/share/pear:/usr/share/php') in [application path withheld]/application/libraries/Doctrine/Common/ClassLoader.php on line 163

I know Doctrine is now looking in the correct directory, but it seems to still think that my grocery_CRUD_Model.php should be in that directory. This file was in the same folder as the other entities before, but it never had any Doctrine annotations. I've tried clearing Doctrine's metadata, query, and result cache to see if Doctrine would forget about this file but it doesn't help.

What's going on here? Why does Doctrine insist on having that file in the Entities folder?

Was it helpful?

Solution

I found the answer, I used grep to try and see if there was some sort of grocery_CRUD_Model cache object file somewhere and I ended up discovering that somehow one of my entities (just one, I must've been experimenting) extended grocery_CRUD_Model.

I removed the inheritance and it worked!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top