/** * 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; }
/** * 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()); }