Beispiel #1
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = GuestPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setEtimeId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setAttending($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setPaid($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setRegDate($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setExtraInfo($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setCreatedAt($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setUpdatedAt($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setTitle($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setFirstname($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setLastname($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setPreferredName($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setEmail($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setPhone($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setMobile($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setPrimaryAddressLine1($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setPrimaryAddressLine2($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setPrimaryAddressLine3($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setPrimaryAddressCity($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setPrimaryAddressPostcode($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setPrimaryAddressState($arr[$keys[19]]);
     }
     if (array_key_exists($keys[20], $arr)) {
         $this->setPrimaryAddressCountry($arr[$keys[20]]);
     }
     if (array_key_exists($keys[21], $arr)) {
         $this->setSecondaryAddressLine1($arr[$keys[21]]);
     }
     if (array_key_exists($keys[22], $arr)) {
         $this->setSecondaryAddressLine2($arr[$keys[22]]);
     }
     if (array_key_exists($keys[23], $arr)) {
         $this->setSecondaryAddressLine3($arr[$keys[23]]);
     }
     if (array_key_exists($keys[24], $arr)) {
         $this->setSecondaryAddressCity($arr[$keys[24]]);
     }
     if (array_key_exists($keys[25], $arr)) {
         $this->setSecondaryAddressPostcode($arr[$keys[25]]);
     }
     if (array_key_exists($keys[26], $arr)) {
         $this->setSecondaryAddressState($arr[$keys[26]]);
     }
     if (array_key_exists($keys[27], $arr)) {
         $this->setSecondaryAddressCountry($arr[$keys[27]]);
     }
     if (array_key_exists($keys[28], $arr)) {
         $this->setSpecialReq($arr[$keys[28]]);
     }
     if (array_key_exists($keys[29], $arr)) {
         $this->setPosition($arr[$keys[29]]);
     }
     if (array_key_exists($keys[30], $arr)) {
         $this->setCompany($arr[$keys[30]]);
     }
     if (array_key_exists($keys[31], $arr)) {
         $this->setSrn($arr[$keys[31]]);
     }
     if (array_key_exists($keys[32], $arr)) {
         $this->setFan($arr[$keys[32]]);
     }
     if (array_key_exists($keys[33], $arr)) {
         $this->setAou($arr[$keys[33]]);
     }
     if (array_key_exists($keys[34], $arr)) {
         $this->setId($arr[$keys[34]]);
     }
 }
Beispiel #2
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(GuestPeer::ID, $pks, Criteria::IN);
         $objs = GuestPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Beispiel #3
0
 public function executeDelete()
 {
     $this->guest = GuestPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->guest);
     try {
         $this->deleteGuest($this->guest);
     } catch (PropelException $e) {
         $this->getRequest()->setError('delete', 'Could not delete the selected Guest. Make sure it does not have any associated items.');
         return $this->forward('guest', 'list?etime_id=' . $this->guest->getEtimeId());
     }
     return $this->redirect('guest/list?etime_id=' . $this->guest->getEtimeId());
 }
Beispiel #4
0
 public function countGuests($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseGuestPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(GuestPeer::ETIME_ID, $this->getId());
     return GuestPeer::doCount($criteria, $distinct, $con);
 }
 public static function doSelectJoinAll(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AdditionalGuestPeer::addSelectColumns($c);
     $startcol2 = AdditionalGuestPeer::NUM_COLUMNS - AdditionalGuestPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     GuestPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + GuestPeer::NUM_COLUMNS;
     GuestPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + GuestPeer::NUM_COLUMNS;
     $c->addJoin(AdditionalGuestPeer::PARENT_GUEST_ID, GuestPeer::ID);
     $c->addJoin(AdditionalGuestPeer::CHILD_GUEST_ID, GuestPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AdditionalGuestPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = GuestPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getGuestRelatedByParentGuestId();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAdditionalGuestRelatedByParentGuestId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAdditionalGuestsRelatedByParentGuestId();
             $obj2->addAdditionalGuestRelatedByParentGuestId($obj1);
         }
         $omClass = GuestPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getGuestRelatedByChildGuestId();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addAdditionalGuestRelatedByChildGuestId($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initAdditionalGuestsRelatedByChildGuestId();
             $obj3->addAdditionalGuestRelatedByChildGuestId($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }