/**
  * Calculate the free places for a given event.
  *
  * @param Tx_WoehrlSeminare_Domain_Model_Event $event
  * @return int
  * @author Alexander Fuchs <*****@*****.**>
  * @api
  */
 public function render(Tx_WoehrlSeminare_Domain_Model_Event $event = NULL)
 {
     if ($event != NULL) {
         $free = $event->getMaxSubscriber() - $this->subscriberRepository->countAllByEvent($event);
     } else {
         $free = 0;
     }
     return $free > 0 ? $free : 0;
 }
Example #2
0
 /**
  * @test
  */
 public function setMaxSubscriberForIntegerSetsMaxSubscriber()
 {
     $this->fixture->setMaxSubscriber(12);
     $this->assertSame(12, $this->fixture->getMaxSubscriber());
 }