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


PHP Employee::setJoinedDate方法代码示例

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


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

示例1: testGetEmployeeYearsOfService

 public function testGetEmployeeYearsOfService()
 {
     $employee = new Employee();
     $employee->setJoinedDate('2007-06-22');
     $employeeDao = $this->getMock('EmployeeDao', array('getEmployee'));
     $employeeDao->expects($this->once())->method('getEmployee')->will($this->returnValue($employee));
     $this->employeeService->setEmployeeDao($employeeDao);
     $years = $this->employeeService->getDurationInYears('2007-06-22', date("Y-m-d"));
     $employeeYearsOfService = $this->employeeService->getEmployeeYearsOfService(1, date("Y-m-d"));
     $this->assertEquals($employeeYearsOfService, $years);
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:11,代码来源:EmployeeYearsOfServiceTest.php

示例2: 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

示例3: import


//.........这里部分代码省略.........
                 $employee->setProvince($data[15]);
             }
         }
     }
     if (strlen($data[18]) <= 100) {
         $employee->setPermanentAddress($data[18]);
     }
     if ($this->isValidEmail($data[19]) && strlen($data[19]) <= 50 && $this->isUniqueEmail($data[19])) {
         $employee->setEmpWorkEmail($data[19]);
     }
     if ($this->isValidEmail($data[20]) && strlen($data[20]) <= 50) {
         $employee->setEmpOthEmail($data[20]);
     }
     if ($this->isValidEmail($data[21]) && strlen($data[21]) <= 50) {
         $employee->setEmpPersonalEmail($data[21]);
     }
     if (strlen($data[22]) <= 25 && $this->isValidPhoneNumber($data[22])) {
         $employee->setEmpMobile($data[22]);
     }
     if (strlen($data[23]) <= 25 && $this->isValidPhoneNumber($data[23])) {
         $employee->setEmpWorkTelephone($data[23]);
     }
     if (strlen($data[24]) <= 25 && $this->isValidPhoneNumber($data[24])) {
         $employee->setEmpHmTelephone($data[24]);
     }
     if (strlen($data[25]) <= 50) {
         $employee->setEmpPhoneAccesscode($data[25]);
     }
     if (strlen($data[26]) <= 50) {
         $employee->setEmpSkypeId($data[26]);
     }
     if ($data[27] != "") {
         $joinedDate = $this->formatDate($data[27]);
         $employee->setJoinedDate($joinedDate);
     }
     $jobTitle = $this->isValidJobTitle($data[28]);
     if (!empty($jobTitle)) {
         $employee->setJobTitleCode($jobTitle);
     }
     if ($data[29] != "" && is_numeric($data[29])) {
         $employee->setTotalExperience($data[29]);
     }
     if ($data[30] != "" && is_numeric($data[30])) {
         $employee->setCurrentExperience($data[30]);
     }
     if ($data[31] != "" && is_numeric($data[31])) {
         $employee->setNoticePeriod($data[31]);
     }
     if (strlen($data[32]) <= 50) {
         $employee->setProject($data[32]);
     }
     if (strlen($data[33]) <= 50) {
         $employee->setReferredBy($data[33]);
     }
     if (strlen($data[34]) <= 50) {
         $employee->setCustom4($data[34]);
     }
     if (strlen($data[38]) <= 50) {
         $employee->setCustom2($data[38]);
     }
     if (strlen($data[39]) <= 50) {
         $employee->setCustom3($data[39]);
     }
     if (strlen($data[40]) <= 50) {
         $employee->setCustom1($data[40]);
     }
开发者ID:abdocmd,项目名称:orangehrm-3.0.1,代码行数:67,代码来源:PimCsvDataImport.php


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