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; }
public function getEventTagsJoinTag($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()); $this->collEventTags = EventTagPeer::doSelectJoinTag($criteria, $con); } } else { $criteria->add(EventTagPeer::EVENT_ID, $this->getId()); if (!isset($this->lastEventTagCriteria) || !$this->lastEventTagCriteria->equals($criteria)) { $this->collEventTags = EventTagPeer::doSelectJoinTag($criteria, $con); } } $this->lastEventTagCriteria = $criteria; return $this->collEventTags; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = EventTagPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setEventId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setTagId($arr[$keys[1]]); } }