Example #1
0
 /**
  * A helper method that returns the composite of queue and registrations in
  * open quota to be further divided
  * 
  * @return array
  */
 public function getNonQuotaRegistrations()
 {
     if (!$this->hasQuotas()) {
         return $this->registrations->toArray();
     }
     $queue = array();
     foreach ($this->quotas as $quota) {
         $queue = array_merge($queue, $quota->getQueue());
     }
     usort($queue, array('\\Prodeko\\IlmoBundle\\Entity\\Registration', 'compareByRegistrationTime'));
     return $queue;
 }
Example #2
0
 /**
  * Get registrations that fit in the quota
  *
  * @return Doctrine\Common\Collections\Collection 
  */
 public function getRegistrations()
 {
     //palauttaa vain tapahtumaan mahtuneet
     return $this->registrations->slice(0, $this->getSize());
 }