本文整理汇总了PHP中EmployeeService::getEmployeeListAsJson方法的典型用法代码示例。如果您正苦于以下问题:PHP EmployeeService::getEmployeeListAsJson方法的具体用法?PHP EmployeeService::getEmployeeListAsJson怎么用?PHP EmployeeService::getEmployeeListAsJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmployeeService
的用法示例。
在下文中一共展示了EmployeeService::getEmployeeListAsJson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmployeeListAsJson
/**
* Get Employee List As Json
* This function should be available in EmployeeService, not here
* Due to backward compatibility temporarily its made available. referencing places need to be pointed to employee service
* and this should be removed
*/
public function getEmployeeListAsJson()
{
try {
$employeeService = new EmployeeService();
return $employeeService->getEmployeeListAsJson();
} catch (Exception $e) {
throw new AdminServiceException($e->getMessage());
}
}
示例2: getEmployeeListAsJson
public function getEmployeeListAsJson()
{
$employeeService = new EmployeeService();
return $employeeService->getEmployeeListAsJson();
}
示例3: executeViewReview
/**
* Handles showing review search form and
* listing searched reviews.
*/
public function executeViewReview(sfWebRequest $request)
{
$performanceReviewService = $this->getPerformanceReviewService();
/* Job title list */
$this->jobList = $this->getJobTitleService()->getJobTitleList("", "", false);
/* Employee list */
if ($this->loggedAdmin) {
$employeeService = new EmployeeService();
$this->empJson = $employeeService->getEmployeeListAsJson();
} elseif ($this->loggedReviewer) {
$this->empJson = $performanceReviewService->getRevieweeListAsJson($this->loggedEmpId, true);
}
/* Showing Performance Review Search form
* ====================================== */
$this->form = new ViewReviewForm(array(), array('empJson' => $this->empJson), true);
/* Subdivision list */
$compStructure = new CompanyStructureService();
$treeObject = $compStructure->getSubunitTreeObject();
$this->tree = $treeObject->fetchTree();
/* Checking whether a newly invoked search form */
$newSearch = false;
if ($request->getParameter('mode') == 'new') {
$newSearch = true;
}
/* Preserving search clues */
$hdnEmpId = $request->getParameter("hdnEmpId");
if (isset($hdnEmpId) && !$newSearch) {
// If the user has performed a new search
$this->clues = $this->getReviewSearchClues($request);
} else {
if ($this->getUser()->hasAttribute('prSearchClues') && !$newSearch) {
$this->clues = $this->getUser()->getAttribute('prSearchClues');
}
if ($this->getUser()->hasFlash('prClues') && !$newSearch) {
$this->clues = $this->getUser()->getFlash('prClues');
}
}
/* Processing reviews
* ================== */
if ($request->isMethod('post')) {
$page = 1;
$this->clues['pageNo'] = 1;
} elseif ($request->getParameter('page')) {
$page = $request->getParameter('page');
$this->clues['pageNo'] = $page;
} elseif ($this->clues['pageNo']) {
$page = $this->clues['pageNo'];
}
/* Preserving search clues */
if (!isset($this->clues)) {
$this->clues = $this->getReviewSearchClues($request);
}
$this->getUser()->setAttribute('prSearchClues', $this->clues);
/* Checking whether wrong seacrch criteria */
if (!$this->_isCorrectEmployee($this->clues['empId'], $this->clues['empName']) || !$this->_isCorrectEmployee($this->clues['reviewerId'], $this->clues['reviewerName'])) {
$this->templateMessage = array('WARNING', __(TopLevelMessages::NO_RECORDS_FOUND));
return;
}
/* Setting logged in user type */
if (!$this->loggedAdmin && $this->loggedReviewer) {
$this->clues['loggedReviewerId'] = $this->loggedEmpId;
} elseif (!$this->loggedAdmin && !$this->loggedReviewer) {
$this->clues['loggedEmpId'] = $this->loggedEmpId;
}
/* Pagination */
if (!isset($page)) {
$page = 1;
}
$this->pager = new SimplePager('PerformanceReview', sfConfig::get('app_items_per_page'));
$this->pager->setPage($page);
$this->pager->setNumResults($performanceReviewService->countReviews($this->clues));
$this->pager->init();
/* Fetching reviews */
$offset = $this->pager->getOffset();
$offset = empty($offset) ? 0 : $offset;
$limit = $this->pager->getMaxPerPage();
$this->reviews = $performanceReviewService->searchPerformanceReview($this->clues, $offset, $limit);
/* Setting template message */
if ($this->getUser()->hasFlash('templateMessage')) {
$this->templateMessage = $this->getUser()->getFlash('templateMessage');
} elseif (count($this->reviews) == 0) {
$this->templateMessage = array('WARNING', __(TopLevelMessages::NO_RECORDS_FOUND));
}
}