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


PHP Result::updateResult方法代碼示例

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


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

示例1: Result

 function is_valid_casual_leave($emp_id, $leave_start_date, $leave_end_date)
 {
     $result = new Result();
     // check if leave is comming into already taken leaves period
     $this->load->model('leave/leave_helper', 'lh');
     $clash_verification = $this->lh->verify_leaves_period($emp_id, $leave_start_date, $leave_end_date);
     $result->updateResult($clash_verification);
     // check if valid balance of casual leaves
     $avail_bal = $this->get_casual_leave_balance($emp_id);
     $applied_period = strtotime($leave_end_date) - strtotime($leave_start_date);
     $applied_period = floor($applied_period / (60 * 60 * 24)) + 1;
     if ($avail_bal < $applied_period) {
         $result->setResult(FALSE);
         $error = "Your leave length is more than available balance. " . "Your available casual leave balance is " . $avail_bal;
         $result->addError($error);
     }
     // check for maximum allowed casual leaves in one stretch
     if ($applied_period > 5) {
         $result->setResult(FALSE);
         $error = "You can take atmost 5 casual leaves in one stretch.";
         $result->addError($error);
     }
     return $result;
 }
開發者ID:pkdism,項目名稱:ISM-MIS,代碼行數:24,代碼來源:leave_casual_model.php

示例2: Result

 function is_valid_restricted_leave($emp_id, $leave_date)
 {
     $result = new Result();
     // modify date to match db date format
     $leave_date = date('Y-m-d', strtotime($leave_date));
     // check if restricted holiday available
     $sql = "SELECT * FROM " . Leave_constants::$TABLE_RESTRICTED_HOLIDAYS . " WHERE holiday_date = '{$leave_date}'";
     $query = $this->db->query($sql);
     if ($query->num_rows() == 0) {
         $result->setResult(FALSE);
         $result->addError("No restricted holiday available.");
     }
     // check if leave is comming into already taken leaves period
     $this->load->model('leave/leave_helper', 'lh');
     $clash_verification = $this->lh->verify_leaves_period($emp_id, $leave_date, $leave_date);
     $result->updateResult($clash_verification);
     // check if balance for leave available
     $balance = $this->get_restricted_leave_balance($emp_id);
     if ($balance < 1) {
         $result->setResult(FALSE);
         $result->addError("Your don't have restricted leaves left.");
     }
     return $result;
 }
開發者ID:pkdism,項目名稱:ISM-MIS,代碼行數:24,代碼來源:leave_restricted_model.php

示例3: Result

 function check_suffix()
 {
     // result to return
     $result = new Result();
     $result->updateResult($this->check_suffix_with_casual_leave());
     if (!$result->getResult()) {
         return $result;
     }
     $result->updateResult($this->check_suffix_with_restricted_leave());
     if (!$result->getResult()) {
         return $result;
     }
     return $result;
 }
開發者ID:pkdism,項目名稱:ISM-MIS,代碼行數:14,代碼來源:leave_helper.php


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