当前位置: 首页>>代码示例>>PHP>>正文


PHP Employee::setEmpNumber方法代码示例

本文整理汇总了PHP中Employee::setEmpNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::setEmpNumber方法的具体用法?PHP Employee::setEmpNumber怎么用?PHP Employee::setEmpNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Employee的用法示例。


在下文中一共展示了Employee::setEmpNumber方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetAccessibleEmployees

 public function testGetAccessibleEmployees()
 {
     $mockService = $this->getMock('EmployeeService');
     $employeeList = new Doctrine_Collection('Employee');
     for ($i = 0; $i < 2; $i++) {
         $employee = new Employee();
         $employee->setEmployeeId($i + 1);
         $employee->setEmpNumber($i + 1);
         $employee->setFirstName("test name" . $i + 1);
         $employeeList->add($employee);
     }
     $mockService->expects($this->once())->method('getSubordinateList')->with(1, true)->will($this->returnValue($employeeList));
     $this->supervisorUserRole->setEmployeeNumber(1);
     $this->supervisorUserRole->setEmployeeService($mockService);
     $employees = $this->supervisorUserRole->getAccessibleEmployees();
     $this->assertEquals(2, count($employees));
     for ($i = 0; $i < 2; $i++) {
         $this->assertEquals($employees[$i + 1], $employeeList[$i]);
     }
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:20,代码来源:SupervisorUserRoleTest.php

示例2: testGetCorporateDirectoryEmployeeDetailsAsArrayWithLoationsAndSubunits

 /**
  * @covers CorporateDirectoryWebServiceHelper::getCorporateDirectoryEmployeeDetailsAsArray
  */
 public function testGetCorporateDirectoryEmployeeDetailsAsArrayWithLoationsAndSubunits()
 {
     $location = new Location();
     $location->setId(1);
     $locationCollection = new Doctrine_Collection('Location');
     $locationCollection->add($location);
     $employee = new Employee();
     $employee->setEmpNumber(1);
     $employee->setFirstName('testEmpFirstName');
     $employee->setLastName('testEmpLastName');
     $employee->setLocations($locationCollection);
     $count = 1;
     $employees = array($employee);
     $employeeDirectoryServiceMock = $this->getMock('EmployeeDirectoryService');
     $employeeDirectoryServiceMock->expects($this->once())->method('searchEmployees')->will($this->returnValue($employees));
     $employeeDirectoryServiceMock->expects($this->once())->method('getSearchEmployeeCount')->will($this->returnValue($count));
     $this->corporateDirectoryWebServiceHelper->setEmployeeDirectoryService($employeeDirectoryServiceMock);
     $employeeDetails = $this->corporateDirectoryWebServiceHelper->getCorporateDirectoryEmployeeDetailsAsArray();
     $this->assertEquals(1, count($employeeDetails));
     $this->assertNotNull($employeeDetails[0]['location_id']);
     $this->assertEquals(1, $employeeDetails[0]['location_id']);
 }
开发者ID:EFForg,项目名称:lemonhrm,代码行数:25,代码来源:CorporateDirectoryWebServiceHelperTest.php

示例3: getEmployeeListForAttendanceTotalSummaryReport

 public function getEmployeeListForAttendanceTotalSummaryReport()
 {
     $employeeList = $this->getEmployeeService()->getEmployeeList('empNumber', 'ASC', true);
     $employee = new Employee();
     $employee->setEmpNumber('-1');
     $employee->setFirstName("All");
     if ($employeeList[0]->getEmpNumber() == null) {
         $employeeList->add($employee);
         return $employeeList;
     } else {
         $employeeList->add($employee);
         return $employeeList;
     }
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:14,代码来源:AdminUserRoleDecorator.php

示例4: searchEmployees

 /**
  * Get employee list after sorting and filtering using given parameters.
  *
  * @param EmployeeSearchParameterHolder $parameterHolder
  */
 public function searchEmployees(EmployeeSearchParameterHolder $parameterHolder)
 {
     $sortField = $parameterHolder->getOrderField();
     $sortOrder = $parameterHolder->getOrderBy();
     $offset = $parameterHolder->getOffset();
     $limit = $parameterHolder->getLimit();
     $filters = $parameterHolder->getFilters();
     $returnType = $parameterHolder->getReturnType();
     $select = '';
     $query = '';
     $bindParams = array();
     $orderBy = '';
     $this->_getEmployeeListQuery($select, $query, $bindParams, $orderBy, $sortField, $sortOrder, $filters);
     $completeQuery = $select . ' ' . $query . ' ' . $orderBy;
     if (!is_null($offset) && !is_null($limit)) {
         $completeQuery .= ' LIMIT ' . $offset . ', ' . $limit;
     }
     if (sfConfig::get('sf_logging_enabled')) {
         $msg = $completeQuery;
         if (count($bindParams) > 0) {
             $msg .= ' (' . implode(',', $bindParams) . ')';
         }
         sfContext::getInstance()->getLogger()->info($msg);
     }
     $conn = Doctrine_Manager::connection();
     $statement = $conn->prepare($completeQuery);
     $result = $statement->execute($bindParams);
     if ($returnType == EmployeeSearchParameterHolder::RETURN_TYPE_OBJECT) {
         $employees = new Doctrine_Collection(Doctrine::getTable('Employee'));
         if ($result) {
             while ($row = $statement->fetch()) {
                 $employee = new Employee();
                 $employee->setEmpNumber($row['empNumber']);
                 $employee->setEmployeeId($row['employeeId']);
                 $employee->setFirstName($row['firstName']);
                 $employee->setMiddleName($row['middleName']);
                 $employee->setLastName($row['lastName']);
                 $employee->setTerminationId($row['terminationId']);
                 $jobTitle = new JobTitle();
                 $jobTitle->setId($row['jobTitleId']);
                 $jobTitle->setJobTitleName($row['jobTitle']);
                 $jobTitle->setIsDeleted($row['isDeleted']);
                 $employee->setJobTitle($jobTitle);
                 $employeeStatus = new EmploymentStatus();
                 $employeeStatus->setId($row['employeeStatusId']);
                 $employeeStatus->setName($row['employeeStatus']);
                 $employee->setEmployeeStatus($employeeStatus);
                 $workStation = new SubUnit();
                 $workStation->setName($row['subDivision']);
                 $workStation->setId($row['subDivisionId']);
                 $employee->setSubDivision($workStation);
                 $supervisorList = isset($row['supervisors']) ? $row['supervisors'] : '';
                 if (!empty($supervisorList)) {
                     $supervisors = new Doctrine_Collection(Doctrine::getTable('Employee'));
                     $supervisorArray = explode(',', $supervisorList);
                     foreach ($supervisorArray as $supervisor) {
                         list($first, $middle, $last) = explode('##', $supervisor);
                         $supervisor = new Employee();
                         $supervisor->setFirstName($first);
                         $supervisor->setMiddleName($middle);
                         $supervisor->setLastName($last);
                         $employee->supervisors[] = $supervisor;
                     }
                 }
                 $locationList = $row['locationIds'];
                 if (!empty($locationList)) {
                     //                    $locations = new Doctrine_Collection(Doctrine::getTable('EmpLocations'));
                     $locationArray = explode(',', $locationList);
                     foreach ($locationArray as $location) {
                         list($id, $name) = explode('##', $location);
                         $empLocation = new Location();
                         $empLocation->setId($id);
                         $empLocation->setName($name);
                         $employee->locations[] = $empLocation;
                     }
                 }
                 $employees[] = $employee;
             }
         }
     } else {
         return $statement->fetchAll();
     }
     return $employees;
 }
开发者ID:CamilleCrespeau,项目名称:orangehrm,代码行数:89,代码来源:EmployeeDao.php

示例5: testGetEmployeeYearsOfService

 /**
  * Test getEmployeeYearsOfService 
  */
 public function testGetEmployeeYearsOfService()
 {
     $empNumber = 12;
     $joinedDate = '2001-02-01';
     $currentDate = '2010-03-04';
     $employee = new Employee();
     $employee->setLastName('Last Name');
     $employee->setFirstName('First Name');
     $employee->setEmpNumber($empNumber);
     $employee->setJoinedDate($joinedDate);
     $mockDao = $this->getMock('EmployeeDao');
     $mockDao->expects($this->once())->method('getEmployee')->with($empNumber)->will($this->returnValue($employee));
     $this->employeeService->setEmployeeDao($mockDao);
     $yearsOfService = $this->employeeService->getEmployeeYearsOfService($empNumber, $currentDate);
     //$this->assertEquals(9, $yearsOfService);
     // Test with non-existant employee
     $mockDao = $this->getMock('EmployeeDao');
     $mockDao->expects($this->once())->method('getEmployee')->with($empNumber)->will($this->returnValue(null));
     $this->employeeService->setEmployeeDao($mockDao);
     try {
         $yearsOfService = $this->employeeService->getEmployeeYearsOfService($empNumber, $currentDate);
         $this->fail("PIMServiceException expected");
     } catch (PIMServiceException $e) {
         // Expected
     }
 }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:29,代码来源:EmployeeServiceTest.php

示例6: testSearchLeaveRequestsEmployeeFilterMultipleEmployees

 public function testSearchLeaveRequestsEmployeeFilterMultipleEmployees()
 {
     $searchParameters = new ParameterStub();
     $dateRange = new DateRangeStub();
     $searchParameters->setParameter('dateRange', $dateRange);
     $searchParameters->setParameter('noOfRecordsPerPage', 50);
     $searchParameters->setParameter('cmbWithTerminated', 'on');
     $employee1 = new Employee();
     $employee1->setEmpNumber(1);
     $employee2 = new Employee();
     $employee2->setEmpNumber(2);
     $searchParameters->setParameter('employeeFilter', array($employee1, $employee2));
     $searchResult = $this->leaveRequestDao->searchLeaveRequests($searchParameters, 1);
     $requestList = $searchResult['list'];
     $requestCount = $searchResult['meta']['record_count'];
     /* Checking type */
     foreach ($requestList as $request) {
         $this->assertTrue($request instanceof LeaveRequest);
     }
     /* Checking count */
     $this->assertEquals(14, count($requestList));
     $this->assertEquals(14, $requestCount);
     /* Checking values and order */
     $this->assertEquals(14, $requestList[0]->getId());
     $this->assertEquals(1, $requestList[0]->getLeaveTypeId());
     $this->assertEquals('2010-08-12', $requestList[0]->getDateApplied());
     $this->assertEquals(2, $requestList[0]->getEmpNumber());
     $this->assertEquals(9, $requestList[13]->getId());
     $this->assertEquals(3, $requestList[13]->getLeaveTypeId());
     $this->assertEquals('2010-06-08', $requestList[13]->getDateApplied());
     $this->assertEquals(1, $requestList[13]->getEmpNumber());
 }
开发者ID:abdocmd,项目名称:orangehrm-3.0.1,代码行数:32,代码来源:LeaveRequestDaoTest.php

示例7: testGetCorporateDirectoryEmployeeDetailsAsArrayWithNullProfilePicture

 public function testGetCorporateDirectoryEmployeeDetailsAsArrayWithNullProfilePicture()
 {
     $employee = new Employee();
     $employee->setEmpNumber(1);
     $employee->setFirstName('testEmpFirstName');
     $employee->setLastName('testEmpLastName');
     $count = 1;
     $employees = array($employee);
     $employeeDirectoryServiceMock = $this->getMock('EmployeeDirectoryService');
     $employeeDirectoryServiceMock->expects($this->once())->method('searchEmployees')->will($this->returnValue($employees));
     $employeeDirectoryServiceMock->expects($this->once())->method('getSearchEmployeeCount')->will($this->returnValue($count));
     $employeeServiceMock = $this->getMock('EmployeeService');
     $employeeServiceMock->expects($this->once())->method('getEmployeePicture')->will($this->returnValue(null));
     $this->corporateDirectoryWebServiceHelper->setEmployeeDirectoryService($employeeDirectoryServiceMock);
     $this->corporateDirectoryWebServiceHelper->setEmployeeService($employeeServiceMock);
     $employeeDetails = $this->corporateDirectoryWebServiceHelper->getCorporateDirectoryEmployeeDetailsAsArray();
     $this->assertNull($employeeDetails[0]['profile_picture']);
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:18,代码来源:CorporateDirectoryWebServiceHelperTest.php


注:本文中的Employee::setEmpNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。