public function findAvailableEnvironements(Environment $defaultEnv)
 {
     /** @var QueryBuilder $qb */
     $qb = $this->createQueryBuilder('e');
     $qb->where($qb->expr()->neq('e.id', ':defaultEnvId'));
     $qb->andWhere('e.managed <> 0');
     $qb->orderBy('e.name', 'ASC');
     $qb->setParameter('defaultEnvId', $defaultEnv->getId());
     return $qb->getQuery()->getResult();
 }
Esempio n. 2
0
 public function findByOuuidAndContentTypeAndEnvironnement(ContentType $contentType, $ouuid, Environment $env)
 {
     $qb = $this->createQueryBuilder('r');
     $qb->join('r.environments', 'e');
     $qb->where('r.ouuid = :ouuid and e.id = :envId and r.contentType = :contentTypeId');
     $qb->setParameters(['ouuid' => $ouuid, 'envId' => $env->getId(), 'contentTypeId' => $contentType->getId()]);
     return $qb->getQuery()->getResult();
 }