diff --git a/module/CalendarBundle/Entity/Node/Event.php b/module/CalendarBundle/Entity/Node/Event.php index e7a88d3772..7c13b0cfef 100644 --- a/module/CalendarBundle/Entity/Node/Event.php +++ b/module/CalendarBundle/Entity/Node/Event.php @@ -397,15 +397,14 @@ public function getTicket(EntityManager $em) * @param EntityManager $em * @return boolean */ - public function hasTicket(EntityManager $em) + public function hasTicket(EntityManager $em): bool { - $tickets = $em->getRepository('TicketBundle\Entity\Event') + $ticket = $em->getRepository('TicketBundle\Entity\Event') ->findOneByEvent($this); - if (is_null($tickets)) { + if (is_null($ticket)) { return false; } -// error_log(json_encode($tickets)); - return (count($tickets) > 0) && $tickets->isStillBookable(); + return $ticket->isStillBookable(); } /**