本文整理汇总了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;
}
示例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();
}