Пример #1
0
 public function getsfSimpleForumCategorys($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BasesfSimpleForumCategoryPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collsfSimpleForumCategorys === null) {
         if ($this->isNew()) {
             $this->collsfSimpleForumCategorys = array();
         } else {
             $criteria->add(sfSimpleForumCategoryPeer::OWNER_ID, $this->getId());
             sfSimpleForumCategoryPeer::addSelectColumns($criteria);
             $this->collsfSimpleForumCategorys = sfSimpleForumCategoryPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(sfSimpleForumCategoryPeer::OWNER_ID, $this->getId());
             sfSimpleForumCategoryPeer::addSelectColumns($criteria);
             if (!isset($this->lastsfSimpleForumCategoryCriteria) || !$this->lastsfSimpleForumCategoryCriteria->equals($criteria)) {
                 $this->collsfSimpleForumCategorys = sfSimpleForumCategoryPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastsfSimpleForumCategoryCriteria = $criteria;
     return $this->collsfSimpleForumCategorys;
 }
 public static function retrieveByPK($id, $owner_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(sfSimpleForumCategoryPeer::ID, $id);
     $criteria->add(sfSimpleForumCategoryPeer::OWNER_ID, $owner_id);
     $v = sfSimpleForumCategoryPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }