예제 #1
0
 public function loadPages()
 {
     $allPages = array('' => '----- select a page -----');
     $c = new Criteria();
     $c->addAscendingOrderByColumn(PagePeer::LABEL);
     $pages = PagePeer::doSelect($c);
     foreach ($pages as $p) {
         $allPages[$p->getId()] = $p->getLabel();
     }
     $this->allPages = $allPages;
 }
예제 #2
0
 public static function website_search(&$c, &$pager)
 {
     self::getSearchParams($context, $user, $request, $keys, $stype);
     $pager = "Page";
     $c->add(PagePeer::LABEL, $keys, Criteria::LIKE);
     $res = PagePeer::doSelect($c);
     $c = new Criteria();
     $c->add(PageI18nPeer::LABEL, $keys, Criteria::LIKE);
     $res2 = PageI18nPeer::doSelect($c);
     $c = new Criteria();
     $c->add(TopicPeer::LABEL, $keys, Criteria::LIKE);
     $res3 = TopicPeer::doSelect($c);
     $c = new Criteria();
     $c->add(TopicI18nPeer::LABEL, $keys, Criteria::LIKE);
     $res4 = TopicI18nPeer::doSelect($c);
     $c = array_merge($res, array_merge($res2, array_merge($res3, $res4)));
 }
예제 #3
0
파일: BasePagePeer.php 프로젝트: kotow/work
 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(PagePeer::ID, $pks, Criteria::IN);
         $objs = PagePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #4
0
파일: Page.php 프로젝트: navid045/maxlaptop
 function getChildren()
 {
     $c = new Criteria();
     return PagePeer::doSelect($c->add(PagePeer::PARENT_ID, $this->id));
 }
예제 #5
0
 /**
  * Gets an array of Page objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this Page has previously been saved, it will retrieve
  * related PagesRelatedByParentId from storage. If this Page is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array Page[]
  * @throws     PropelException
  */
 public function getPagesRelatedByParentId($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(PagePeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPagesRelatedByParentId === null) {
         if ($this->isNew()) {
             $this->collPagesRelatedByParentId = array();
         } else {
             $criteria->add(PagePeer::PARENT_ID, $this->id);
             PagePeer::addSelectColumns($criteria);
             $this->collPagesRelatedByParentId = PagePeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(PagePeer::PARENT_ID, $this->id);
             PagePeer::addSelectColumns($criteria);
             if (!isset($this->lastPageRelatedByParentIdCriteria) || !$this->lastPageRelatedByParentIdCriteria->equals($criteria)) {
                 $this->collPagesRelatedByParentId = PagePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastPageRelatedByParentIdCriteria = $criteria;
     return $this->collPagesRelatedByParentId;
 }
예제 #6
0
 /**
  * Returns the whole tree node for a given scope
  *
  * @param      Criteria $criteria	Optional Criteria to filter the query
  * @param      PropelPDO $con	Connection to use.
  * @return     Page			Propel object for root node
  */
 public static function retrieveTree(Criteria $criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(PagePeer::DATABASE_NAME);
     }
     $criteria->addAscendingOrderByColumn(PagePeer::LEFT_COL);
     return PagePeer::doSelect($criteria, $con);
 }