public function getUserhobbiess($criteria = null, $con = null) { include_once 'lib/model/om/BaseUserhobbiesPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collUserhobbiess === null) { if ($this->isNew()) { $this->collUserhobbiess = array(); } else { $criteria->add(UserhobbiesPeer::HOBBIES_ID, $this->getId()); UserhobbiesPeer::addSelectColumns($criteria); $this->collUserhobbiess = UserhobbiesPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(UserhobbiesPeer::HOBBIES_ID, $this->getId()); UserhobbiesPeer::addSelectColumns($criteria); if (!isset($this->lastUserhobbiesCriteria) || !$this->lastUserhobbiesCriteria->equals($criteria)) { $this->collUserhobbiess = UserhobbiesPeer::doSelect($criteria, $con); } } } $this->lastUserhobbiesCriteria = $criteria; return $this->collUserhobbiess; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(UserhobbiesPeer::ID, $pks, Criteria::IN); $objs = UserhobbiesPeer::doSelect($criteria, $con); } return $objs; }