Пример #1
0
 /**
  * @param  QueryBuilder $qb qb
  * @throws \Exception
  */
 protected function filterSubjects($qb)
 {
     $ids = array();
     foreach ($this->getSubjects() as $component) {
         $id = $component->getId();
         if (empty($id)) {
             throw new \Exception('Component has to be fetched from database');
         }
         $ids[] = $id;
     }
     $qb->innerJoin('action.timelines', 'timeline')->andWhere('timeline.subject IN (:subjectIds)')->setParameter('subjectIds', $ids);
 }