Beispiel #1
0
 /**
  * [data description]
  * @param  [type] $store [description]
  * @return [type]        [description]
  */
 public static function data($store)
 {
     static $cache_datastore;
     if (isset($cache_datastore[$store])) {
         return $cache_datastore[$store];
     }
     if (strpos($store, ':') === false && !self::$app->isAbsolutePath($store)) {
         $path = "data:{$store}.yaml";
     } else {
         $path = $store;
     }
     if ($file = self::$app->path($path)) {
         if (is_null($cache_datastore)) {
             $cache_datastore = [];
         }
         $cache_datastore[$store] = self::$app->helper('yaml')->fromFile($file);
         return DataCollection::create($cache_datastore[$store]);
     }
     return [];
 }