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(UserfriendPeer::ID, $pks, Criteria::IN); $objs = UserfriendPeer::doSelect($criteria, $con); } return $objs; }
public function getUserfriends($criteria = null, $con = null) { include_once 'lib/model/om/BaseUserfriendPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collUserfriends === null) { if ($this->isNew()) { $this->collUserfriends = array(); } else { $criteria->add(UserfriendPeer::FRIEND_ID, $this->getId()); UserfriendPeer::addSelectColumns($criteria); $this->collUserfriends = UserfriendPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(UserfriendPeer::FRIEND_ID, $this->getId()); UserfriendPeer::addSelectColumns($criteria); if (!isset($this->lastUserfriendCriteria) || !$this->lastUserfriendCriteria->equals($criteria)) { $this->collUserfriends = UserfriendPeer::doSelect($criteria, $con); } } } $this->lastUserfriendCriteria = $criteria; return $this->collUserfriends; }