/** * Get list of subordinate employee Ids as an array on integers * * @return type Comma separated list or false if no subordinates */ private function _getSubordinateIds($supervisorId) { $employeeService = new EmployeeService(); $employeeService->setEmployeeDao(new EmployeeDao()); $subordinatesList = $employeeService->getSubordinateList($supervisorId, true); $ids = array(); foreach ($subordinatesList as $employee) { $ids[] = intval($employee->getEmpNumber()); } return $ids; }
protected function getEmployeeList() { $employeeService = new EmployeeService(); $employeeList = array(); if (Auth::instance()->hasRole(Auth::ADMIN_ROLE)) { $properties = array("empNumber", "firstName", "middleName", "lastName", 'termination_id'); $employeeList = UserRoleManagerFactory::getUserRoleManager()->getAccessibleEntityProperties('Employee', $properties); } if ($_SESSION['isSupervisor'] && trim(Auth::instance()->getEmployeeNumber()) != "") { $employeeList = $employeeService->getSubordinateList(Auth::instance()->getEmployeeNumber()); } return $employeeList; }
private function _getSubordinatesList() { if (!empty($this->subordinatesList)) { return $this->subordinatesList; } else { $employeeService = new EmployeeService(); $employeeService->setEmployeeDao(new EmployeeDao()); $this->subordinatesList = $employeeService->getSubordinateList($this->loggedUserId, true); return $this->subordinatesList; } }