Example #1
0
 private function findMatchingByTags(FilterEntity $filter)
 {
     $tags = $this->tagFinder->getAllTagsForFilter($filter);
     $tagIds = array_unique(array_map(function ($e) {
         return $e->getId();
     }, $tags));
     return $tagIds;
 }
Example #2
0
 public function getAvailableTagsFor(File $file)
 {
     $repo = $this->em->getRepository("PluPhorgBundle:Tag");
     $usedTags = $this->tagFinder->getAllTagsForFile($file);
     if ($usedTags == array()) {
         // doctrine bugs.
         return $repo->findAll();
     }
     $qb = $repo->createQueryBuilder("t")->where("t not in ( :tags )")->setParameter("tags", $usedTags);
     return $qb->getQuery()->getResult();
 }