當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application_Model_User::getMapper方法代碼示例

本文整理匯總了PHP中Application_Model_User::getMapper方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application_Model_User::getMapper方法的具體用法?PHP Application_Model_User::getMapper怎麽用?PHP Application_Model_User::getMapper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Application_Model_User的用法示例。


在下文中一共展示了Application_Model_User::getMapper方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: contactsAction

 public function contactsAction()
 {
     /*--search---*/
     $search = trim($this->_getParam('search'));
     $where = "status!='deleted'";
     $this->view->linkArray = array();
     $this->view->search = "Search...";
     if ($search != "" && $search != "Search...") {
         $where = "(first_name like '%{$search}%' or last_name like '%{$search}%' or email like '%{$search}%' or extension_no like '%{$search}%' or skype like '%{$search}%' or d.title like '%{$search}%') and status='active' ";
         $this->view->linkArray = array('search' => $search);
         $this->view->search = $search;
     }
     $this->view->page_size = $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $model = new Application_Model_User();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("u" => 'user'))->join(array("d" => 'department'), 'u.department_id=d.id', array('department_name' => 'title'))->order('first_name ASC')->where($where);
     //echo $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
開發者ID:riteshsahu1981,項目名稱:we,代碼行數:24,代碼來源:EmployeeController.php

示例2: employeesAction

 public function employeesAction()
 {
     /*--search---*/
     $search = trim($this->_getParam('search'));
     $status = trim($this->_getParam('status'));
     $department_id = trim($this->_getParam('department_id'));
     $designation_id = trim($this->_getParam('designation_id'));
     $where = "status!='deleted'";
     $this->view->linkArray = array();
     $this->view->search = "Search...";
     if ($search != "" && $search != "Search...") {
         $where = "(first_name like '%{$search}%' or last_name like '%{$search}%' or email like '%{$search}%' or skype like '%{$search}%' or d.title like '%{$search}%' or  username like '%{$search}%' or  employee_code like '%{$search}%') and status!='deleted'";
         $this->view->linkArray = array('search' => $search);
         $this->view->search = $search;
     }
     if ($status != "") {
         if (is_null($where)) {
             $where .= " status='{$status}'";
         } else {
             $where .= " and status='{$status}'";
         }
         $linkArray['status'] = $status;
         $this->view->status = $status;
     }
     if ($department_id != "") {
         if (is_null($where)) {
             $where .= " department_id='{$department_id}'";
         } else {
             $where .= " and department_id='{$department_id}'";
         }
         $linkArray['department_id'] = $department_id;
         $this->view->department_id = $department_id;
     }
     if ($designation_id != "") {
         if (is_null($where)) {
             $where .= " designation_id='{$designation_id}'";
         } else {
             $where .= " and designation_id='{$designation_id}'";
         }
         $linkArray['designation_id'] = $designation_id;
         $this->view->designation_id = $designation_id;
     }
     $this->view->page_size = $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $model = new Application_Model_User();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("u" => 'user'))->join(array("d" => 'department'), 'u.department_id=d.id', array('department_name' => 'title'))->order('first_name ASC')->where($where);
     //echo $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
     $department = new Application_Model_Department();
     $this->view->departments = $department->getDepartment();
     $designation = new Application_Model_Designation();
     $this->view->designations = $designation->getDesignation();
 }
開發者ID:riteshsahu1981,項目名稱:we,代碼行數:58,代碼來源:HrController.php


注:本文中的Application_Model_User::getMapper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。