當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserListFactory::getHighestEmployeeNumberByCompanyId方法代碼示例

本文整理匯總了PHP中UserListFactory::getHighestEmployeeNumberByCompanyId方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserListFactory::getHighestEmployeeNumberByCompanyId方法的具體用法?PHP UserListFactory::getHighestEmployeeNumberByCompanyId怎麽用?PHP UserListFactory::getHighestEmployeeNumberByCompanyId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserListFactory的用法示例。


在下文中一共展示了UserListFactory::getHighestEmployeeNumberByCompanyId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postInstall

 function postInstall()
 {
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     $clf = new CompanyListFactory();
     $clf->StartTransaction();
     $clf->getAll();
     if ($clf->getRecordCount() > 0) {
         foreach ($clf as $c_obj) {
             if ($c_obj->getStatus() == 10) {
                 $ulf = new UserListFactory();
                 $ulf->getHighestEmployeeNumberByCompanyId($c_obj->getId());
                 if ($ulf->getRecordCount() > 0) {
                     $next_available_employee_number = $ulf->getCurrent()->getEmployeeNumber() + 1;
                 } else {
                     $next_available_employee_number = 1;
                 }
                 $ulf->getByCompanyId($c_obj->getId(), NULL, NULL, NULL, array('hire_date' => 'asc'));
                 if ($ulf->getRecordCount() > 0) {
                     foreach ($ulf as $u_obj) {
                         if ($u_obj->getEmployeeNumber() == '') {
                             Debug::text('Setting Employee Number to: ' . $next_available_employee_number . ' for ' . $u_obj->getUserName(), __FILE__, __LINE__, __METHOD__, 9);
                             $u_obj->setEmployeeNumber($next_available_employee_number);
                             if ($u_obj->isValid()) {
                                 $u_obj->Save();
                                 $next_available_employee_number++;
                             }
                         } else {
                             Debug::text('NOT Setting Employee Number for ' . $u_obj->getUserName() . ' already set to: ' . $u_obj->getEmployeeNumber(), __FILE__, __LINE__, __METHOD__, 9);
                         }
                     }
                 }
             }
         }
     }
     //$clf->FailTransaction();
     $clf->CommitTransaction();
     return TRUE;
 }
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:38,代碼來源:InstallSchema_1008A.class.php

示例2: unset

     $utlf->getByCompanyId($mapped_row['company_id']);
     $title_options = (array) $utlf->getArrayByListFactory($utlf, FALSE, TRUE);
     unset($utlf);
     $uf->setCompany(Misc::importCallInputParseFunction('company_id', $mapped_row['company_id'], $filtered_import_map['company_id']['default_value'], $filtered_import_map['company_id']['parse_hint']));
 }
 if (isset($mapped_row['status_id']) and $mapped_row['status_id'] != '') {
     $uf->setStatus(Misc::importCallInputParseFunction('status_id', $mapped_row['status_id'], $filtered_import_map['status_id']['default_value'], $filtered_import_map['status_id']['parse_hint']));
 }
 if (isset($mapped_row['currency_id']) and $mapped_row['currency_id'] != '') {
     $uf->setCurrency(Misc::importCallInputParseFunction('currency_id', $mapped_row['currency_id'], $filtered_import_map['currency_id']['default_value'], $filtered_import_map['currency_id']['parse_hint']));
 }
 if (isset($mapped_row['employee_number']) and $mapped_row['employee_number'] != '') {
     $uf->setEmployeeNumber(Misc::importCallInputParseFunction('employee_number', $mapped_row['employee_number'], $filtered_import_map['employee_number']['default_value'], $filtered_import_map['employee_number']['parse_hint']));
 } else {
     $ulf = new UserListFactory();
     $ulf->getHighestEmployeeNumberByCompanyId($mapped_row['company_id']);
     if ($ulf->getRecordCount() > 0) {
         $next_employee_number = $ulf->getCurrent()->getEmployeeNumber() + 1;
         $uf->setEmployeeNumber($next_employee_number);
     }
     unset($ulf, $next_employee_number);
 }
 if (isset($mapped_row['pay_period_schedule_id']) and $mapped_row['pay_period_schedule_id'] != '') {
     $uf->setPayPeriodSchedule(Misc::importCallInputParseFunction('pay_period_schedule_id', $mapped_row['pay_period_schedule_id'], $filtered_import_map['pay_period_schedule_id']['default_value'], $filtered_import_map['pay_period_schedule_id']['parse_hint']));
 }
 if (isset($mapped_row['policy_group_id']) and $mapped_row['policy_group_id'] != '') {
     $uf->setPolicyGroup(Misc::importCallInputParseFunction('policy_group_id', $mapped_row['policy_group_id'], $filtered_import_map['policy_group_id']['default_value'], $filtered_import_map['policy_group_id']['parse_hint']));
 }
 if (isset($mapped_row['default_branch_id']) and $mapped_row['default_branch_id'] != '') {
     $tmp_branch = Misc::importCallInputParseFunction('default_branch_id', $mapped_row['default_branch_id'], $filtered_import_map['default_branch_id']['default_value'], $filtered_import_map['default_branch_id']['parse_hint']);
     if ($create_branch === TRUE) {
開發者ID:alachaum,項目名稱:timetrex,代碼行數:31,代碼來源:import_users.php

示例3: array

     $udlf->getByCompanyId($company_id);
     if ($udlf->getRecordCount() > 0) {
         Debug::Text('Using User Defaults', __FILE__, __LINE__, __METHOD__, 10);
         $udf_obj = $udlf->getCurrent();
         $user_data = array('company_id' => $company_id, 'title_id' => $udf_obj->getTitle(), 'employee_number' => $udf_obj->getEmployeeNumber(), 'city' => $udf_obj->getCity(), 'province' => $udf_obj->getProvince(), 'country' => $udf_obj->getCountry(), 'work_phone' => $udf_obj->getWorkPhone(), 'work_phone_ext' => $udf_obj->getWorkPhoneExt(), 'work_email' => $udf_obj->getWorkEmail(), 'hire_date' => $udf_obj->getHireDate(), 'default_branch_id' => $udf_obj->getDefaultBranch(), 'default_department_id' => $udf_obj->getDefaultDepartment(), 'permission_control_id' => $udf_obj->getPermissionControl(), 'pay_period_schedule_id' => $udf_obj->getPayPeriodSchedule(), 'policy_group_id' => $udf_obj->getPolicyGroup(), 'currency_id' => $udf_obj->getCurrency());
     }
     if (!isset($user_obj)) {
         $user_obj = $ulf->getByIdAndCompanyId($current_user->getId(), $company_id)->getCurrent();
     }
     if (!isset($user_data['company_id'])) {
         $user_data['company_id'] = $company_id;
     }
     if (!isset($user_data['country'])) {
         $user_data['country'] = 'CA';
     }
     $ulf->getHighestEmployeeNumberByCompanyId($company_id);
     if ($ulf->getRecordCount() > 0) {
         Debug::Text('Highest Employee Number: ' . $ulf->getCurrent()->getEmployeeNumber(), __FILE__, __LINE__, __METHOD__, 10);
         if (is_numeric($ulf->getCurrent()->getEmployeeNumber()) == TRUE) {
             $user_data['next_available_employee_number'] = $ulf->getCurrent()->getEmployeeNumber() + 1;
         } else {
             Debug::Text('Highest Employee Number is not an integer.', __FILE__, __LINE__, __METHOD__, 10);
             $user_data['next_available_employee_number'] = NULL;
         }
     } else {
         $user_data['next_available_employee_number'] = 1;
     }
     if (!isset($user_data['hire_date']) or $user_data['hire_date'] == '') {
         $user_data['hire_date'] = time();
     }
 }
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:EditUser.php


注:本文中的UserListFactory::getHighestEmployeeNumberByCompanyId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。