Beispiel #1
0
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new ModelCache();
     }
     return self::$instance;
 }
Beispiel #2
0
 /**
  * Get a shared instace of current model
  *
  * @param string $model_name The name of model
  * @return mixed The model instance
  */
 public static function model($model_name)
 {
     $model_name = ucfirst($model_name);
     $modelcache = ModelCache::get_instance();
     return @$modelcache->{$model_name};
 }