本文整理汇总了PHP中Employee::getEmpNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::getEmpNumber方法的具体用法?PHP Employee::getEmpNumber怎么用?PHP Employee::getEmpNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Employee
的用法示例。
在下文中一共展示了Employee::getEmpNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveEmployee
/**
* Save Employee
* @param Employee $employee
* @returns boolean
* @throws DaoException
*/
public function saveEmployee(Employee $employee)
{
try {
if ($employee->getEmpNumber() == '') {
$idGenService = new IDGeneratorService();
$idGenService->setEntity($employee);
$employee->setEmpNumber($idGenService->getNextID());
}
$employee->save();
return $employee;
// @codeCoverageIgnoreStart
} catch (Exception $e) {
throw new DaoException($e->getMessage(), $e->getCode(), $e);
}
// @codeCoverageIgnoreEnd
}
示例2: getEmployeeAllowedToApplyLeaveTypes
/**
*
* @param Employee $employee
* @return LeaveType Collection
*/
public function getEmployeeAllowedToApplyLeaveTypes(Employee $employee)
{
try {
$leaveEntitlementService = $this->getLeaveEntitlementService();
$strategy = $this->getLeaveEntitlementService()->getLeaveEntitlementStrategy();
$leaveTypeService = $this->getLeaveTypeService();
$leaveTypes = $leaveTypeService->getLeaveTypeList();
$leaveTypeList = array();
foreach ($leaveTypes as $leaveType) {
$balance = $leaveEntitlementService->getLeaveBalance($employee->getEmpNumber(), $leaveType->getId());
if ($balance->getEntitled() > 0) {
array_push($leaveTypeList, $leaveType);
}
}
return $leaveTypeList;
} catch (Exception $e) {
throw new LeaveServiceException($e->getMessage());
}
}
示例3: getEmployeeAllowedToApplyLeaveTypes
/**
*
* @param Employee $employee
* @return LeaveType Collection
*/
public function getEmployeeAllowedToApplyLeaveTypes(Employee $employee)
{
try {
$leavePeriodService = $this->getLeavePeriodService();
$leavePeriod = $leavePeriodService->getCurrentLeavePeriod();
$leaveEntitlementService = $this->getLeaveEntitlementService();
$leaveTypeService = $this->getLeaveTypeService();
$leaveTypes = $leaveTypeService->getLeaveTypeList();
$leaveTypeList = array();
foreach ($leaveTypes as $leaveType) {
$entitlementDays = $leaveEntitlementService->getLeaveBalance($employee->getEmpNumber(), $leaveType->getLeaveTypeId(), $leavePeriod->getLeavePeriodId());
if ($entitlementDays > 0) {
array_push($leaveTypeList, $leaveType);
}
}
return $leaveTypeList;
} catch (Exception $e) {
throw new LeaveServiceException($e->getMessage());
}
}
示例4: saveContactDetails
/**
* Save Contact Details
* @param Employee $employee
* @returns boolean
* @throws DaoException
*/
public function saveContactDetails(Employee $employee)
{
try {
$countryCode = $employee->country;
$q = Doctrine_Query::create()->update('Employee')->set('street1', '?', $employee->getStreet1())->set('street2', '?', $employee->getStreet2())->set('city', '?', $employee->getCity())->set('province', '?', $employee->getProvince())->set('emp_zipcode', '?', $employee->getEmpZipcode())->set('emp_hm_telephone', '?', $employee->getEmpHmTelephone())->set('emp_mobile', '?', $employee->getEmpMobile())->set('emp_work_telephone', '?', $employee->getEmpWorkTelephone())->set('emp_work_email', '?', $employee->getEmpWorkEmail())->set('emp_oth_email', '?', $employee->getEmpOthEmail());
if (trim($employee->country) == "") {
$q->set('country', '?', 'NULL');
} else {
$q->set('country', '?', $employee->country);
}
$q->where('empNumber = ?', $employee->getEmpNumber());
$q->execute();
return true;
} catch (Exception $e) {
throw new DaoException($e->getMessage());
}
}