public function getlistbymenu($param) { $menuType = WebMenuTypePeer::retrieveByPK($param['type']); if (!$menuType) { $this->jsonwrapper->show_json_error('not found', 'Menu tidak ditemukan'); } /* if($menuType->getDepartmentId() == 1){ $this->criteria->add(WebItemCategoryPeer::DEPARTMENT_ID, 1, Criteria::EQUAL); }else{ $this->criteria->add(WebItemCategoryPeer::DEPARTMENT_ID, 0, Criteria::EQUAL); } */ $this->criteria->addAscendingOrderByColumn(WebItemCategoryPeer::PARENT_ID); $category = WebItemCategoryPeer::doSelect($this->criteria); $parentMapping = new ParentMapping(); $tree = $parentMapping->generateItemcategoryList($category); $output = array('success' => 1, 'data' => $tree); $this->jsonwrapper->print_json($output); }
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(WebItemCategoryPeer::ID, $pks, Criteria::IN); $objs = WebItemCategoryPeer::doSelect($criteria, $con); } return $objs; }