PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
helpSystem
/
modules
/
client
/
models
/
dao
<?php /** * TopicDao class file. * @author Digital Mesh <info@digitalmesh.com> * @copyright Copyright © Digital Mesh 2013- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License * @package HelpSystem */ /** * * This Component is add dao functions * */ class TopicDao extends CApplicationComponent { /** * getSection is a public function * here we fetch all the topics under * the sectionId reference * @param INT $sectionId * @return ARRAY $result */ public function getSection($sectionId) { $criteria = new CDbCriteria(); $criteria->condition = "t.ParentId IS NULL AND t.SectionId =:sectionId "; $criteria->params = array(":sectionId"=>$sectionId); $criteria->with = array("Topics"); $criteria->order ="t.Order ASC,Topics.Order ASC"; $result = Topic::model()->findAll($criteria); return $result; } /** * getTopic is a public function * here we fetch the topic details * using topicId as reference * @param INT $topicId * @return ARRAY $result */ public function getTopic($topicId) { return $result = Yii::app()->db->createCommand() ->select("Title,Body") ->from('hlp_TopicText') ->where("TopicId = :tid", array(':tid'=>$topicId)) ->queryRow(); } }
[+]
..
[-] TopicDao.php
[edit]