You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Nice and clear bundle, thank you for your work!
I have problem/proposition: I need to add/remove tags from my services.
Now, bundle only allow to add tags via listener.
What do you think, @garak it will be better, if we can have some service that manages tags and its relations?
Inside listener we can call such service and avoid copypasting.
If you agreed my idea, I can try to PR it.
The text was updated successfully, but these errors were encountered:
I'm not sure to understand your use case. You can add/remove tags without using bundle's functionality, just relying on normal Doctrine entities relations.
I has the same problem, here is how I solved it:
I first get my tag entity I want to add, then I try to save the entity:
$tag = $this->getDoctrine()->getRepository(Tag::class)->find($id);
if(!$entity->hasTag($destinationTag)) {
$entity->addTag($destinationTag);
}
// THIS NEXT LINE IS MANDATORY, DOESN'T WORK IF THE FIELD "UPDATED" IS NOT UPDATED
$entity->setTagsText($entity->getTagsText());
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($entity);
$entityManager->flush();
Hi!
Nice and clear bundle, thank you for your work!
I have problem/proposition: I need to add/remove tags from my services.
Now, bundle only allow to add tags via listener.
What do you think, @garak it will be better, if we can have some service that manages tags and its relations?
Inside listener we can call such service and avoid copypasting.
If you agreed my idea, I can try to PR it.
The text was updated successfully, but these errors were encountered: