Пример #1
0
 /**
  * strict singletion
  * for later no paramter call
  *
  * @return self
  */
 static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = call_user_func_array(array('parent', 'getInstance'), func_get_args());
         self::$isInitialized = true;
     }
     return self::$instance;
 }
Пример #2
0
 /**
  * find the latest usable version
  *
  * @return self
  */
 static function getInstance()
 {
     if (!\ApiModel::isInitialized()) {
         return parent::getInstance();
     }
     $name = preg_replace('/Api(\\\\\\w+)?\\\\(V\\dd\\dd\\d\\\\)?Action\\\\/', '', get_called_class());
     $name = substr($name, 0, -5);
     return \ApiModel::getInstance()->getObject(\ApiModel::TYPE_ACTION, $name);
 }