Skip to content

Commit

Permalink
[saveTagging method] add clause in doctrine query to delete only tagg…
Browse files Browse the repository at this point in the history
…ing of the resource given in parameter
  • Loading branch information
sebastien-cas committed Jun 26, 2012
1 parent f66f23d commit 17358f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/DoctrineExtensions/Taggable/TagManager.php
Expand Up @@ -173,6 +173,10 @@ public function saveTagging(Taggable $resource)
->delete($this->taggingClass, 't')
->where('t.tag_id')
->where($builder->expr()->in('t.tag', $tagsToRemove))
->andWhere('t.resourceType = :resourceType')
->setParameter('resourceType', $resource->getTaggableType())
->andWhere('t.resourceId = :resourceId')
->setParameter('resourceId', $resource->getTaggableId())
->getQuery()
->getResult()
;
Expand Down

0 comments on commit 17358f2

Please sign in to comment.