本文整理汇总了PHP中Branch::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::select方法的具体用法?PHP Branch::select怎么用?PHP Branch::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Branch
的用法示例。
在下文中一共展示了Branch::select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
// $options = $this->getFrontController()->getParam('bootstrap')->getApplication()->getOptions();
$model = new Branch();
$select = $model->select();
$request = $this->getRequest();
$page = $request->getParam('page', 1);
$sort = $request->getParam('sort', 'web_name');
$order = $request->getParam('order', 'asc');
$select->where('ghost = false');
$select->order($sort . ' ' . $order);
// $this->view->assign('paginator', new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select)));
// $paginator->setCurrentPageNumber($page);
// $this->view->paginator = $paginator;
$paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
$paginator->setCurrentPageNumber($page);
$this->view->paginator = $paginator;
$this->view->headers = array('branch_name', 'web_name', 'type', 'id_status', 'city', 'province');
}
示例2: getBranchesInGroup
public function getBranchesInGroup($id)
{
$branch = new Branch();
$select = $branch->select()->from('branch')->join('branch_branch_group', 'branch.id= branch_branch_group.id_branch', array())->where('branch_branch_group.id_branch_group = ?', $id)->where('branch.ghost = false and branch_branch_group.ghost = false')->order(array('branch.created_at', 'branch.id'))->setIntegrityCheck(false);
return $select;
}
示例3: __construct
public function __construct()
{
$this->categories_list = Categories::select()->orderBy('category')->get();
$this->branch_list = Branch::select()->orderBy('id')->get();
$this->student_categories_list = StudentCategories::select()->orderBy('cat_id')->get();
}
示例4: getDataToUserReport
public function getDataToUserReport()
{
$profileModel = new Profile();
$select = $profileModel->select()->order('id_user');
$profileDataArray = $profileModel->fetchAll($select)->toArray();
$groupModel = new Group();
$select = $groupModel->select();
$groupDataArray = $groupModel->fetchAll($select)->toArray();
foreach ($groupDataArray as $key => $value) {
$tmp[$value['id']] = $value;
}
$groupDataArray = $tmp;
unset($tmp);
$branchModel = new Branch();
$select = $branchModel->select();
$branchDataArray = $branchModel->fetchAll($select)->toArray();
foreach ($branchDataArray as $key => $value) {
$tmp[$value['id']] = $value;
}
$branchDataArray = $tmp;
unset($tmp);
$userModel = new User();
$select = $userModel->select();
$userDataArray = $userModel->fetchAll($select)->toArray();
foreach ($userDataArray as $key => $value) {
$tmp[$value['id']] = $value;
}
$userDataArray = $tmp;
unset($tmp);
$roleModel = new Role();
$select = $roleModel->select();
$roleDataArray = $roleModel->fetchAll($select)->toArray();
foreach ($roleDataArray as $key => $value) {
$tmp[$value['id']] = $value;
}
$roleDataArray = $tmp;
unset($tmp);
$groupArray = array();
foreach ($profileDataArray as $key => $value) {
$data = $this->getAuthorizationsForProfile($value['id']);
foreach ($data as $key2 => $values) {
foreach ($values as $key3 => $privs) {
/* if ($privs['ghost'] === true) {
unset($data[$key2][$key3]);
continue;
}
*/
$tmp = array('login' => '', 'surname' => '', 'first_name' => '', 'group' => '', 'role' => '', 'branch' => '', 'ghost' => '');
if ($key2 === 'group') {
$tmp['group'] = $groupDataArray[$privs['id_group']]['group_name'];
}
if ($key2 === 'role') {
$tmp['role'] = $roleDataArray[$privs['id_role']]['description'];
}
$tmp['login'] = $userDataArray[$value['id_user']]['login'];
$tmp['surname'] = $userDataArray[$value['id_user']]['surname'];
$tmp['first_name'] = $userDataArray[$value['id_user']]['first_name'];
$tmp['branch'] = $branchDataArray[$value['id_branch']]['branch_name'];
$tmp['ghost'] = $userDataArray['ghost'] ? 'NIEAKTYWNY' : 'AKTYWNY';
$groupArray[] = $tmp;
}
}
}
return $groupArray;
}