当前位置: 首页>>代码示例>>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;未经允许,请勿转载。