Exemple #1
0
 /**
  * Load model definition from cache if exists; if not, build model
  */
 protected function loadDefinition()
 {
     $cache = PerfORMController::getCache();
     $cacheKey = $this->getCacheKey();
     if (isset($cache[$cacheKey]) and is_object($cache[$cacheKey]) and get_class($cache[$cacheKey]) == get_class($this)) {
         foreach ($cache[$cacheKey]->getProperties() as $property => $value) {
             $this->{$property} = $value;
         }
     } else {
         $this->buildDefinition();
     }
 }