Skip to content

Commit

Permalink
resolve count() error in Entity/Node/Event
Browse files Browse the repository at this point in the history
  • Loading branch information
rserry committed Jan 26, 2024
1 parent 248214a commit 290d030
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions module/CalendarBundle/Entity/Node/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 290d030

Please sign in to comment.