/** * Gets an array of Fbo objects which contain a foreign key that references this object. * * If this collection has already been initialized with an identical Criteria, it returns the collection. * Otherwise if this Airport has previously been saved, it will retrieve * related Fbos from storage. If this Airport is new, it will return * an empty collection or the current collection, the criteria is ignored on a new object. * * @param PropelPDO $con * @param Criteria $criteria * @return array Fbo[] * @throws PropelException */ public function getFbos($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(AirportPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collFbos === null) { if ($this->isNew()) { $this->collFbos = array(); } else { $criteria->add(FboPeer::AIRPORT_ID, $this->id); FboPeer::addSelectColumns($criteria); $this->collFbos = FboPeer::doSelect($criteria, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return the collection. $criteria->add(FboPeer::AIRPORT_ID, $this->id); FboPeer::addSelectColumns($criteria); if (!isset($this->lastFboCriteria) || !$this->lastFboCriteria->equals($criteria)) { $this->collFbos = FboPeer::doSelect($criteria, $con); } } } $this->lastFboCriteria = $criteria; return $this->collFbos; }
<label>Origin Address</label> <?php echo select_tag('ground_origin', options_for_select($ground_addr_sel, $sf_params->has('ground_origin') ? $sf_params->get('ground_origin') : $leg->getGroundOrigin(), array('include_custom' => '-- select --')), array("onchange" => "changeGroundMissionDetails(this)")); ?> </div> <div class="wrap"> <label>Destination Address</label> <?php echo select_tag('ground_destination', options_for_select($ground_addr_sel, $sf_params->has('ground_destination') ? $sf_params->get('ground_destination') : $leg->getGroundDestination(), array('include_custom' => '-- select --')), array("onchange" => "changeGroundMissionDetails(this)")); ?> </div> <?php $c = new Criteria(); $c->add(FboPeer::NAME, '', Criteria::NOT_EQUAL); $c->addAscendingOrderByColumn(FboPeer::NAME); $fbo_addresses = FboPeer::doSelect($c); foreach ($fbo_addresses as $fbo_address) { $options[$fbo_address->getId()] = $fbo_address->getName(); } ?> <div class="wrap"> <label>FBO Name</label> <?php echo select_tag('fbo_address', options_for_select($options, $leg ? $leg->getFboId() : null, array('include_custom' => '-- select --'))); ?> </div> <div class="wrap"> <label>FBO Address</label> <input type="text" name="fbo_address_new" value="<?php echo $new_fbo_address; ?>
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(FboPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(FboPeer::DATABASE_NAME); $criteria->add(FboPeer::ID, $pks, Criteria::IN); $objs = FboPeer::doSelect($criteria, $con); } return $objs; }