Ejemplo n.º 1
0
 /**
  * Rules:
  * - People older than 2 takes a bed
  * - More than three persons takes another room
  * @see	Kortkursus
  */
 function getRoomsNeeded()
 {
     $vaerelser = 0;
     $person = 0;
     foreach ($this->getDeltagere() as $d) {
         $deltager = new VIH_Model_KortKursus_Tilmelding_Deltager($this, $d['id']);
         if ($deltager->calculateAge($deltager->get('birthday'), $this->kursus->get('startdato')) > 2) {
             $person++;
         }
     }
     return ceil($person / 2);
 }