示例#1
0
 public function getPageByParent($initial, $parentId)
 {
     $frontpagetools = new frontpageTools();
     $frontpagetools->getDepartment();
     $websection = $frontpagetools->getDepartment();
     $criteria = new Criteria();
     $criteria->add(WebMenuPeer::INITIAL, $initial, Criteria::EQUAL);
     $criteria->add(WebMenuPeer::PARENT_ID, $parentId, Criteria::EQUAL);
     $criteria->addJoin(WebMenuPeer::MENU_TYPE_ID, WebMenuTypePeer::ID);
     $criteria->add(WebMenuTypePeer::DEPARTMENT_ID, $websection->getId(), Criteria::LIKE);
     return WebMenuPeer::doSelectOne($criteria);
 }
示例#2
0
 public function getWebMenusJoinWebComponent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseWebMenuPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collWebMenus === null) {
         if ($this->isNew()) {
             $this->collWebMenus = array();
         } else {
             $criteria->add(WebMenuPeer::MENU_TYPE_ID, $this->getId());
             $this->collWebMenus = WebMenuPeer::doSelectJoinWebComponent($criteria, $con);
         }
     } else {
         $criteria->add(WebMenuPeer::MENU_TYPE_ID, $this->getId());
         if (!isset($this->lastWebMenuCriteria) || !$this->lastWebMenuCriteria->equals($criteria)) {
             $this->collWebMenus = WebMenuPeer::doSelectJoinWebComponent($criteria, $con);
         }
     }
     $this->lastWebMenuCriteria = $criteria;
     return $this->collWebMenus;
 }
示例#3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = WebMenuPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setInitial($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setTitle($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDefaultPage($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setPageTemplatesId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setMenuTypeId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setComponentId($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setBanner($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setParentId($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setSublevel($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setLink($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setOrdering($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setCreated($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setPublished($arr[$keys[13]]);
     }
 }
示例#4
0
 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(WebMenuPeer::ID, $pks, Criteria::IN);
         $objs = WebMenuPeer::doSelect($criteria, $con);
     }
     return $objs;
 }