Beispiel #1
0
 /**
  * Loads the mapping of the models with resource types
  * @return null
  */
 protected function loadModelMapping()
 {
     $modelTypesCacheItem = $this->cache->get(self::CACHE_TYPES);
     if ($modelTypesCacheItem->isValid()) {
         $this->modelTypes = $modelTypesCacheItem->getValue();
         return;
     }
     $this->modelTypes = array();
     $models = $this->orm->getModels();
     foreach ($models as $modelName => $model) {
         $type = $model->getMeta()->getOption('json.api');
         if (!$type) {
             continue;
         }
         $this->modelTypes[$modelName] = $type;
     }
     $modelTypesCacheItem->setValue($this->modelTypes);
     $this->cache->set($modelTypesCacheItem);
 }