/** * Gets an array of EventWings 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 Event has previously been saved, it will retrieve * related EventWingss from storage. If this Event 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 EventWings[] * @throws PropelException */ public function getEventWingss($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(EventPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collEventWingss === null) { if ($this->isNew()) { $this->collEventWingss = array(); } else { $criteria->add(EventWingsPeer::EVENT_ID, $this->id); EventWingsPeer::addSelectColumns($criteria); $this->collEventWingss = EventWingsPeer::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(EventWingsPeer::EVENT_ID, $this->id); EventWingsPeer::addSelectColumns($criteria); if (!isset($this->lastEventWingsCriteria) || !$this->lastEventWingsCriteria->equals($criteria)) { $this->collEventWingss = EventWingsPeer::doSelect($criteria, $con); } } } $this->lastEventWingsCriteria = $criteria; return $this->collEventWingss; }
<?php include_stylesheets_for_form($form); include_javascripts_for_form($form); if ($form->getObject()->getId() != '') { $c = new Criteria(); $c->add(EventWingsPeer::EVENT_ID, $form->getObject()->getId()); $ch = EventWingsPeer::doSelect($c); } ?> <form action="<?php echo url_for('event/' . ($form->getObject()->isNew() ? 'create' : 'update') . (!$form->getObject()->isNew() ? '?id=' . $form->getObject()->getId() : '')); ?> " method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" '; ?> > <?php if (!$form->getObject()->isNew()) { ?> <input type="hidden" name="sf_method" value="put" /> <?php } ?> <table> <tfoot> <tr> <td colspan="2"> <?php echo $form->renderHiddenFields(); ?>
/** * Retrieve object using using composite pkey values. * @param int $event_id @param int $wing_id * @param PropelPDO $con * @return EventWings */ public static function retrieveByPK($event_id, $wing_id, PropelPDO $con = null) { $key = serialize(array((string) $event_id, (string) $wing_id)); if (null !== ($obj = EventWingsPeer::getInstanceFromPool($key))) { return $obj; } if ($con === null) { $con = Propel::getConnection(EventWingsPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $criteria = new Criteria(EventWingsPeer::DATABASE_NAME); $criteria->add(EventWingsPeer::EVENT_ID, $event_id); $criteria->add(EventWingsPeer::WING_ID, $wing_id); $v = EventWingsPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }