Beispiel #1
0
 public function executeGenerateUnused()
 {
     $criteria = new Criteria();
     // get SESSION macs
     $session_macs = $this->getUser()->getAttribute('macs_in_wizard', array());
     $criteria->add(EtvaMacPeer::ID, $session_macs, Criteria::NOT_IN);
     $criteria->add(EtvaMacPeer::IN_USE, 0);
     $etva_mac = EtvaMacPeer::doSelectOne($criteria);
     if (!$etva_mac) {
         return false;
     }
     $mac = $etva_mac->getId();
     // add the current mac at the beginning of the array
     array_unshift($session_macs, $mac);
     // store the new mac back into the session
     $this->getUser()->setAttribute('macs_in_wizard', $session_macs);
     return $etva_mac->toArray();
 }