Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 1.0.0ALPHA1
-
Fix Version/s: 1.0.0ALPHA1
-
Component/s: None
-
Labels:None
Description
When I enable metadataCache:
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcCache());
My custom repository stops working. For I example I have a method findAllAssoc.
witout enabling metadata cache it works fine.
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Undefined method 'findAllAssoc'. The method name must start with either findBy or findOneBy!' in /data/sites/mongodb_odm/lib/Doctrine/ODM/MongoDB/DocumentRepository.php:197
Stack trace:
#0 [internal function]: Doctrine\ODM\MongoDB\DocumentRepository->__call('findAllAssoc', Array)
#1 /data/sites/cms.enkorting.nl/application/modules/user/controllers/IndexController.php(72): Doctrine\ODM\MongoDB\DocumentRepository->findAllAssoc()
Cheers, Onno
When you enable your metadata cache, it is pulling your mapping information from the cache instead of from your files. So it is probably pulling an older version that does not have the customRepositoryClassName property populated. Clear your metadata cache and it should work fine.