getEntityManager()->createQueryBuilder() ->select("t") ->from(\models\summit\SummitAttendeeTicket::class, "t"); $tickets = $query ->where('t.external_order_id = :external_order_id') ->andWhere('t.external_attendee_id = :external_attendee_id') ->setParameter('external_order_id', $external_order_id) ->setParameter('external_attendee_id', $external_attendee_id)->getQuery()->getResult(); return count($tickets) > 0 ? $tickets[0] : null; } /** * @return string */ protected function getBaseEntity() { return SummitAttendeeTicket::class; } }