Пример #1
0
 public function getEventTags($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseEventTagPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collEventTags === null) {
         if ($this->isNew()) {
             $this->collEventTags = array();
         } else {
             $criteria->add(EventTagPeer::EVENT_ID, $this->getId());
             EventTagPeer::addSelectColumns($criteria);
             $this->collEventTags = EventTagPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(EventTagPeer::EVENT_ID, $this->getId());
             EventTagPeer::addSelectColumns($criteria);
             if (!isset($this->lastEventTagCriteria) || !$this->lastEventTagCriteria->equals($criteria)) {
                 $this->collEventTags = EventTagPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastEventTagCriteria = $criteria;
     return $this->collEventTags;
 }
Пример #2
0
 public static function retrieveByPK($event_id, $tag_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(EventTagPeer::EVENT_ID, $event_id);
     $criteria->add(EventTagPeer::TAG_ID, $tag_id);
     $v = EventTagPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }