Exemple #1
0
 public function executeSummary()
 {
     $this->forward404Unless($this->getRequestParameter('parent_id'));
     $c = new Criteria();
     $c->add(GuestPeer::ID, $this->getRequestParameter('parent_id'));
     $this->rootGuest = GuestPeer::doSelectOne($c);
     $this->forward404Unless($this->rootGuest);
     $c = new Criteria();
     $c->add(AdditionalGuestPeer::PARENT_GUEST_ID, $this->getRequestParameter('parent_id'));
     $c->addAscendingOrderByColumn(AdditionalGuestPeer::CHILD_GUEST_ID);
     $this->additional_guests = AdditionalGuestPeer::doSelect($c);
     $this->forward404Unless($this->additional_guests);
     $this->form_fields = $this->getFormFields($this->rootGuest->getEtime()->getEventId(), true);
     $this->forward404Unless($this->form_fields);
     $this->labels = $this->getLabels();
 }
Exemple #2
0
 public function getAdditionalGuestsRelatedByChildGuestId($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseAdditionalGuestPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collAdditionalGuestsRelatedByChildGuestId === null) {
         if ($this->isNew()) {
             $this->collAdditionalGuestsRelatedByChildGuestId = array();
         } else {
             $criteria->add(AdditionalGuestPeer::CHILD_GUEST_ID, $this->getId());
             AdditionalGuestPeer::addSelectColumns($criteria);
             $this->collAdditionalGuestsRelatedByChildGuestId = AdditionalGuestPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(AdditionalGuestPeer::CHILD_GUEST_ID, $this->getId());
             AdditionalGuestPeer::addSelectColumns($criteria);
             if (!isset($this->lastAdditionalGuestRelatedByChildGuestIdCriteria) || !$this->lastAdditionalGuestRelatedByChildGuestIdCriteria->equals($criteria)) {
                 $this->collAdditionalGuestsRelatedByChildGuestId = AdditionalGuestPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastAdditionalGuestRelatedByChildGuestIdCriteria = $criteria;
     return $this->collAdditionalGuestsRelatedByChildGuestId;
 }
 public static function retrieveByPK($parent_guest_id, $child_guest_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(AdditionalGuestPeer::PARENT_GUEST_ID, $parent_guest_id);
     $criteria->add(AdditionalGuestPeer::CHILD_GUEST_ID, $child_guest_id);
     $v = AdditionalGuestPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }