/** * Má událost prodané lístky? * * @param App\Model\Entity\Event $event */ function hasSoldTickets($event) { foreach ($event->getTicketInfos() as $ticketInfo) { if (count($ticketInfo->getTickets()) > 0) { return TRUE; } } return FALSE; }