示例#1
0
 private function loadLoanRules()
 {
     if (is_null($this->loanRules)) {
         /** @var Memcache $memCache */
         global $memCache;
         global $configArray;
         $this->loanRules = $memCache->get('loan_rules');
         if (!$this->loanRules) {
             $this->loanRules = array();
             $loanRule = new LoanRule();
             $loanRule->find();
             while ($loanRule->fetch()) {
                 $this->loanRules[$loanRule->loanRuleId] = clone $loanRule;
             }
         }
         $memCache->set('loan_rules', $this->loanRules, $configArray['Caching']['loan_rules']);
         $this->loanRuleDeterminers = $memCache->get('loan_rule_determiners');
         if (!$this->loanRuleDeterminers) {
             $this->loanRuleDeterminers = array();
             $loanRuleDeterminer = new LoanRuleDeterminer();
             //$loanRuleDeterminer->active = 1;
             $loanRuleDeterminer->orderBy('rowNumber DESC');
             $loanRuleDeterminer->find();
             while ($loanRuleDeterminer->fetch()) {
                 $this->loanRuleDeterminers[$loanRuleDeterminer->rowNumber] = clone $loanRuleDeterminer;
             }
         }
         $memCache->set('loan_rule_determiners', $this->loanRuleDeterminers, $configArray['Caching']['loan_rules']);
     }
 }
示例#2
0
 function getObjectStructure()
 {
     return LoanRule::getObjectStructure();
 }
示例#3
0
 protected function loadLoanRules()
 {
     if (is_null($this->loanRules)) {
         /** @var Memcache $memCache */
         global $memCache;
         global $configArray;
         global $serverName;
         $this->loanRules = $memCache->get($serverName . '_loan_rules');
         if (!$this->loanRules || isset($_REQUEST['reload'])) {
             $this->loanRules = array();
             $loanRule = new LoanRule();
             $loanRule->find();
             while ($loanRule->fetch()) {
                 $this->loanRules[$loanRule->loanRuleId] = clone $loanRule;
             }
         }
         $memCache->set($serverName . '_loan_rules', $this->loanRules, 0, $configArray['Caching']['loan_rules']);
         $this->loanRuleDeterminers = $memCache->get($serverName . '_loan_rule_determiners');
         if (!$this->loanRuleDeterminers || isset($_REQUEST['reload'])) {
             $this->loanRuleDeterminers = array();
             $loanRuleDeterminer = new LoanRuleDeterminer();
             $loanRuleDeterminer->active = 1;
             $loanRuleDeterminer->orderBy('rowNumber DESC');
             $loanRuleDeterminer->find();
             while ($loanRuleDeterminer->fetch()) {
                 $this->loanRuleDeterminers[$loanRuleDeterminer->rowNumber] = clone $loanRuleDeterminer;
             }
         }
         $memCache->set($serverName . '_loan_rule_determiners', $this->loanRuleDeterminers, 0, $configArray['Caching']['loan_rules']);
     }
 }