Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method getResourceIdsForTag of my entity Tag, not working #30

Open
AntonioMalatestaISA opened this issue Aug 19, 2015 · 1 comment
Open

Comments

@AntonioMalatestaISA
Copy link

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

@amacado
Copy link

amacado commented Dec 13, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants