getInstance() публичный статический Метод

Return the current object instance (Singleton)
public static getInstance ( ) : static
Результат static The object instance
Пример #1
0
 /**
  * Persists a Contao parameter.
  *
  * @param string $key   The key
  * @param mixed  $value The value
  */
 public function persistConfig($key, $value)
 {
     $config = Config::getInstance();
     $config->persist($key, $value);
     $config->save();
 }
Пример #2
0
 /**
  * Retrieve the config in use.
  *
  * @return Config
  */
 public static function getConfig()
 {
     if (!self::$config) {
         return self::$config = Config::getInstance();
     }
     return self::$config;
 }
Пример #3
0
 /**
  * Initializes the Config class.
  */
 public function initialize()
 {
     $this->config = Config::getInstance();
 }