/** * Get the list of users that have requested admin access to a show. */ public function getRequestedShowAdmins(Show $show) { $query = $this->createQueryBuilder('u')->innerJoin('u.aces', 'e')->where("e.type = 'request-show'")->andWhere('e.entityId = :id')->andWhere('e.grantedBy IS NULL')->andWhere('e.revokedBy IS NULL')->setParameter('id', $show->getId())->getQuery(); return $query->getResult(); }
/** * Get an ACE request request made by a user for the show. */ public function findAceRequest(User $user, Show $show) { $qb = $this->createQueryBuilder('e'); $query = $qb->where('e.user = :user')->andWhere('e.entityId = :entityId')->andWhere("e.type = 'request-show'")->setParameter('user', $user)->setParameter('entityId', $show->getId()); return $query->getQuery()->getOneOrNullResult(); }