remove tag from entry #1377

This commit is contained in:
Thomas Citharel
2016-02-10 17:41:28 +01:00
parent ae5b37ef2e
commit 567421af50
5 changed files with 74 additions and 2 deletions

View File

@ -51,4 +51,20 @@ class TagRepository extends EntityRepository
->getQuery()
->getResult();
}
/**
* Used only in test case to get a tag for our entry.
*
* @return Tag
*/
public function findOnebyEntryAndLabel($entry, $label)
{
return $this->createQueryBuilder('t')
->leftJoin('t.entries', 'e')
->where('e.id = :entryId')->setParameter('entryId', $entry->getId())
->andWhere('t.label = :label')->setParameter('label', $label)
->setMaxResults(1)
->getQuery()
->getSingleResult();
}
}