本文整理汇总了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);
}
示例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
}
}
示例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]);
}