FabienPennequin/DoctrineExtensions-Taggable

Method getResourceIdsForTag of my entity Tag, not working

Opened this issue · 1 comments

When i get repository for class Tag in controller:
'''
$tagRepo = $this->getDoctrine()->getManager()->getRepository(mybundle:Tag);
'''
and then call the method "getResourceIdsForTag" :
'''
$tagRepo->getResourceIdsForTag('my_resource', 'my_tag);
'''
Return the error ###ndefined method 'getResourceIdsForTag'. The method name must start with either findBy or findOneBy!###

The problem is that my entity (It is extending the BaseTag entity, as it is written in the documentation) not view the entityRepository located in the doctrine-extension-taggable.

Actually I solved my problem by creating my EntityRepository copying the code from TagRepository located inside doctrine-extension-taggable.

Maybe I wrong something ?
Thanks a lot

Hey Antonio, I got the same issue as you. I solved it nearly the same as you except to add the doctrine repository class directly (not copying). Like this:

@ORM\Entity(repositoryClass="DoctrineExtensions\Taggable\Entity\TagRepository").

PS: I know it's an old issue but may it help some others.