Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-8

custom repositories don't work when setting MetadataCacheImpl

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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

        Activity

        Hide
        Jonathan H. Wage added a comment -

        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.

        Show
        Jonathan H. Wage added a comment - 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.
        Hide
        Onno Schmidt added a comment -

        Somehow, I am still not able to get this to work. Even when I clear the cache I get the message that my custom methods can't be found. I will try to create reproducible case.

        Show
        Onno Schmidt added a comment - Somehow, I am still not able to get this to work. Even when I clear the cache I get the message that my custom methods can't be found. I will try to create reproducible case.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Onno Schmidt
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: