本文整理匯總了PHP中Model_Category::isLeaf方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Category::isLeaf方法的具體用法?PHP Model_Category::isLeaf怎麽用?PHP Model_Category::isLeaf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model_Category
的用法示例。
在下文中一共展示了Model_Category::isLeaf方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getMaterialsByTeacher
public function getMaterialsByTeacher($pagination, $teacher_id = NULL, $node_id = NULL, $filter = NULL)
{
$cat = new Model_Category();
$qry = DB::select('materials.*', array('users.name', 'name'))->join('users', 'left')->on('users.id', '=', 'materials.teacher_id')->from('materials');
if ($teacher_id) {
$qry->where('teacher_id', '=', $teacher_id);
}
if ($node_id) {
$qry->where('node_id', '=', $node_id);
}
if (isset($filter['FIO']) && $filter['FIO'] != '') {
$qry->where('name', 'like', '%' . $filter['FIO'] . '%');
}
if (!$teacher_id) {
$qry->order_by('users.name', 'asc');
}
if ($pagination) {
$data = $qry->order_by('subjectName', 'asc')->order_by('ctime', 'asc')->limit($pagination->items_per_page)->offset($pagination->offset)->execute()->as_array();
} else {
$data = $qry->order_by('subjectName', 'asc')->order_by('ctime', 'asc')->execute()->as_array();
}
foreach ($data as $key => $item) {
$data[$key]['path'] = $cat->getPath($item['node_id']);
$data[$key]['isLeaf'] = $cat->isLeaf($item['node_id']);
$data[$key]['link'] = $this->getLink($item);
}
return $data;
}