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']); } }
function getObjectStructure() { return LoanRule::getObjectStructure(); }
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']); } }