getInstance() public static méthode

Return the current object instance (Singleton)
public static getInstance ( ) : static
Résultat static The object instance
Exemple #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();
 }
Exemple #2
0
 /**
  * Retrieve the config in use.
  *
  * @return Config
  */
 public static function getConfig()
 {
     if (!self::$config) {
         return self::$config = Config::getInstance();
     }
     return self::$config;
 }
 /**
  * Initializes the Config class.
  */
 public function initialize()
 {
     $this->config = Config::getInstance();
 }