本文整理汇总了PHP中EmployeeService::setEmployeeDao方法的典型用法代码示例。如果您正苦于以下问题:PHP EmployeeService::setEmployeeDao方法的具体用法?PHP EmployeeService::setEmployeeDao怎么用?PHP EmployeeService::setEmployeeDao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmployeeService
的用法示例。
在下文中一共展示了EmployeeService::setEmployeeDao方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBulkAssignLeaveEntitlements
public function testBulkAssignLeaveEntitlements()
{
$this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmLeavePlugin/test/fixtures/LeaveEntitlement.yml';
TestDataService::populate($this->fixture);
$dao = new LeaveEntitlementDao();
$limit = 5000;
$empList = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
for ($i = 0; $i < $limit; $i++) {
$employee = new Employee();
$employee->setFirstName($i);
$employee = $employeeService->saveEmployee($employee);
array_push($empList, $employee->getEmpNumber());
}
$start_time = microtime(true);
$leaveEntitlement = new LeaveEntitlement();
$leaveEntitlement->setLeaveTypeId(1);
$leaveEntitlement->setCreditedDate(date('Y-m-d'));
$leaveEntitlement->setEntitlementType(LeaveEntitlement::ENTITLEMENT_TYPE_ADD);
$leaveEntitlement->setDeleted(0);
$leaveEntitlement->setNoOfDays(2);
$leaveEntitlement->setFromDate('2012-01-01');
$leaveEntitlement->setToDate('2012-08-01');
$result = $dao->bulkAssignLeaveEntitlements($empList, $leaveEntitlement);
$deference = microtime(true) - $start_time;
$this->assertEquals(count($empList), $result, "Time Deference - " . $deference);
echo "Add Entitlement 5000 Time " . $deference;
}
示例2: getEmployeeService
public function getEmployeeService()
{
if (is_null($this->employeeService)) {
$empService = new EmployeeService();
$empService->setEmployeeDao(new EmployeeDao());
$this->employeeService = $empService;
}
return $this->employeeService;
}
示例3: getProjectAdminListAsJson
public function getProjectAdminListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeList = $employeeService->getEmployeeList();
foreach ($employeeList as $employee) {
$jsonArray[] = array('name' => $employee->getFullName(), 'id' => $employee->getEmpNumber());
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例4: getSupervisorListAsJson
public function getSupervisorListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeList = $employeeService->getSupervisorList();
foreach ($employeeList as $employee) {
$name = $employee->getFirstName() . " " . $employee->getMiddleName();
$name = trim(trim($name) . " " . $employee->getLastName());
$jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例5: execute
public function execute($request)
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeList = $employeeService->getSubordinateListForEmployee($request->getGetParameter('id'));
foreach ($employeeList as $subordinate) {
$employee = $subordinate->getSubordinate();
$name = $employee->getFirstName() . " " . $employee->getMiddleName();
$name = trim(trim($name) . " " . $employee->getLastName());
$jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
}
$jsonString = json_encode($jsonArray);
echo $jsonString;
exit;
}
示例6: getEmployeeListAsJson
public function getEmployeeListAsJson($employeeList)
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeUnique = array();
foreach ($employeeList as $employee) {
if (!isset($employeeUnique[$employee->getEmpNumber()])) {
$name = $employee->getFullName();
$employeeUnique[$employee->getEmpNumber()] = $name;
$jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
}
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例7: getProjectAdminListAsJson
public function getProjectAdminListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$properties = array("empNumber", "firstName", "middleName", "lastName", 'termination_id');
$employeeList = $employeeService->getEmployeePropertyList($properties, 'empNumber', 'ASC');
foreach ($employeeList as $employee) {
$name = trim(trim($employee['firstName'] . ' ' . $employee['middleName'], ' ') . ' ' . $employee['lastName']);
if ($employee['termination_id']) {
$name = $name . ' (' . __('Past Employee') . ')';
}
$jsonArray[] = array('name' => $name, 'id' => $employee['empNumber']);
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例8: getEmployeeListAsJson
public function getEmployeeListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeList = UserRoleManagerFactory::getUserRoleManager()->getAccessibleEntities('Employee');
$employeeUnique = array();
$jsonArray[] = array('name' => __('All'), 'id' => '');
foreach ($employeeList as $employee) {
if (!isset($employeeUnique[$employee->getEmpNumber()])) {
$name = $employee->getFullName();
$employeeUnique[$employee->getEmpNumber()] = $name;
$jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
}
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例9: getEmployeeListAsJson
public function getEmployeeListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeUnique = array();
foreach ($this->employeeList as $employee) {
$empNumber = $employee['empNumber'];
if (!isset($employeeUnique[$empNumber])) {
$name = trim(trim($employee['firstName'] . ' ' . $employee['middleName'], ' ') . ' ' . $employee['lastName']);
if ($employee['termination_id']) {
$name = $name . ' (' . __('Past Employee') . ')';
}
$employeeUnique[$empNumber] = $name;
$jsonArray[] = array('name' => $name, 'id' => $empNumber);
}
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例10: getEmployeeListAsJson
public function getEmployeeListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeService instanceof EmployeeService;
$employeeList = $employeeService->getEmployeePropertyList(array('empNumber', 'firstName', 'lastName', 'middleName', 'termination_id'), 'lastName', 'ASC');
$terminationLabel = ' (' . __('Past Employee') . ')';
$jsonArray[] = array('name' => __('All'), 'id' => '');
foreach ($employeeList as $employee) {
$name = $employee['firstName'] . " " . $employee['middleName'];
$name = trim(trim($name) . " " . $employee['lastName']);
if ($employee['termination_id']) {
$name .= $terminationLabel;
}
$jsonArray[] = array('name' => $name, 'id' => $employee['empNumber']);
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例11: getHiringManagerListAsJson
/**
*
* @return <type>
*/
public function getHiringManagerListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$properties = array("empNumber", "firstName", "middleName", "lastName", "termination_id");
$employeeList = $employeeService->getEmployeePropertyList($properties, 'lastName', 'ASC', true);
foreach ($employeeList as $employee) {
$empNumber = $employee['empNumber'];
$name = trim(trim($employee['firstName'] . ' ' . $employee['middleName'], ' ') . ' ' . $employee['lastName']);
$jsonArray[] = array('name' => $name, 'id' => $empNumber);
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}
示例12: getEmployeeList
public function getEmployeeList($trackId)
{
$empNameList = array();
$existReviewersList = $this->getReviwerIdList($trackId);
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$properties = array("empNumber", "firstName", "middleName", "lastName");
$employeeList = $employeeService->getEmployeePropertyList($properties, 'lastName', 'ASC', true);
foreach ($employeeList as $employee) {
$empNumber = $employee['empNumber'];
if (!in_array($empNumber, $existReviewersList)) {
$name = trim(trim($employee['firstName'] . ' ' . $employee['middleName'], ' ') . ' ' . $employee['lastName']);
$empNameList[$empNumber] = $name;
}
}
$this->employeeList = $empNameList;
return $empNameList;
}
示例13: _getSubordinateIds
/**
* 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->getSupervisorEmployeeChain($supervisorId, true);
$ids = array();
foreach ($subordinatesList as $employee) {
$ids[] = intval($employee->getEmpNumber());
}
return $ids;
}
示例14: _getSubordinatesList
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;
}
}
示例15: getEmployeeListAsJson
public function getEmployeeListAsJson()
{
$jsonArray = array();
$employeeService = new EmployeeService();
$employeeService->setEmployeeDao(new EmployeeDao());
$employeeList = $employeeService->getEmployeeList('empNumber', 'ASC');
$employeeUnique = array();
foreach ($employeeList as $employee) {
if (!isset($employeeUnique[$employee->getEmpNumber()])) {
$name = $employee->getFirstName() . " " . $employee->getMiddleName();
$name = trim(trim($name) . " " . $employee->getLastName());
$employeeUnique[$employee->getEmpNumber()] = $name;
$jsonArray[] = array('name' => $name, 'id' => $employee->getEmpNumber());
}
}
$jsonString = json_encode($jsonArray);
return $jsonString;
}