DoctrineExtensions-Taggable
DoctrineExtensions-Taggable copied to clipboard
Incomplete readme files
Sorry but in your readme.md file you say "Finally, you need to setup doctrine for register metadata directory and register TagListener." Ok. But where I have to put this code? How can I configure doctrine for this stuff?
Thank you in advance.
I'm struggling with this too. Installed via FPNTagBundle as per the documentation and I can create tags and add them to entities OK but can't get the repository to work :(
in an action:
$em = $this->getDoctrine()->getEntityManager();
$tagRepo = $em->getRepository('DoctrineExtensions\\Taggable\\Entity\\Tag');
$ids = $tagRepo->getResourceIdsForTag('organisation', $tag);
I get
Class DoctrineExtensions\Taggable\Entity\Tag is not a valid entity or mapped super class.
It's bound to be something simple, but I don't know enough about the Doctrine configuration to fix this. Can you help, please @FabienPennequin?
I am also struggling with this. Does anyone have a good step by step procedure for a newbie?
You can try to add the annotation to your Tag Entity
@ORM\Entity(repositoryClass="DoctrineExtensions\Taggable\Entity\TagRepository")
and using the repo
$em = $this->getDoctrine()->getEntityManager();
$tagRepo = $em->getRepository('YourBundle:Tag');
$ids = $tagRepo->getResourceIdsForTag('organisation', $tag);
This have work for me (symfony 2.1.5)
You can also extend the included TagRepository if you need to have a repository of your own.
<?php
namespace App\Bundle\TagBundle\Entity;
use Doctrine\ORM\NoResultException;
use DoctrineExtensions\Taggable\Entity\TagRepository as BaseRepository;
class TagRepository extends BaseRepository {
//...
Now you can do
$em = $this->getDoctrine()->getEntityManager();
$tagRepo = $em->getRepository('YourBundle:Tag');
$ids = $tagRepo->getResourceIdsForTag('organisation', $tag);
like @estheban has above.
Hi !
Same here, I began to integrate this bundle to my project but I'm stock at the :
"Finally, you need to setup doctrine for register metadata directory and register TagListener."
I just need the file where to put this code. I search on google and found this post on google :
https://groups.google.com/forum/#!topic/symfony2/tqxGRLiEDTs
But I can see the link, it seems to have work for this guy.
Thank's,
Anthony
This is the shittiest readme file ever written. Actually pissed me off, it's like it was written to be purposefully confusing