In my app I have several custom repositories which are mapped with respective Entity classes and orm.yml files.
They are all defined in the same manner and structure apart of course their names and members.
Yet when I try to get the custom repositories, just for a specific one I get the super class of the repository instead of the correct repository.
$a = $this->em->getRepository('MyAppCommonBundle:Activity'); //doesn't work
$b = $this->em->getRepository('MyAppCommonBundle:Activity:User'); //works
$c= $this->em->getRepository('MyAppCommonBundle:ActivityStatus'); //works
MyAppCommonBundle is defined: MyAppCommonBundle' => 'MyApp\CommonBundle\Entity
$a returns the wrong super class Doctrine\ORM\EntityRepository while $b returns the correct MyApp\CommonBundle\Repository\UserRepository and $c is MyApp\CommonBundle\Repository\ActivityStatus
All Entities are in the same folder MyApp\CommonBundle\Entity. All repositories are in the same place too MyApp\CommonBundle\Repository.
Activity.orm.yml:
MyApp\CommonBundle\Entity\Activity:
type: entity
table: activity
repositoryClass: MyApp\CommonBundle\Repository\ActivityRepository
indexes:
and for example User.orm.yml:
MyApp\CommonBundle\Entity\User:
type: entity
table: user
repositoryClass: MyApp\CommonBundle\Repository\UserRepository
Activity Repository:
<?php
namespace MyApp\CommonBundle\Repository;
use Doctrine\ORM\EntityRepository;
class ActivityRepository extends EntityRepository
{
User Repository:
<?php
namespace MyApp\CommonBundle\Repository;
use Doctrine\ORM\EntityRepository;
class UserRepository extends EntityRepository
...
As stated above, User and other repositories are found, Activity is not...
I tried clearing cache, rebuilding entities with no effect. Obviously tried to look for typos etc. but looks good.
Any idea? Thanks