Pop\Config::changesAllowed PHP Метод

changesAllowed() публичный Метод

Method to return if changes to the config are allowed.
public changesAllowed ( ) : boolean
Результат boolean
    public function changesAllowed()
    {
        return $this->allowChanges;
    }

Usage Example

Пример #1
0
 /**
  * Load a project config
  *
  * @param  mixed $config
  * @throws Exception
  * @return \Pop\Project\Project
  */
 public function loadConfig($config)
 {
     // Test to see if the config is already set and changes are allowed.
     if (null !== $this->config && !$this->config->changesAllowed()) {
         throw new Exception('Real-time configuration changes are not allowed.');
     }
     // Else, set the new config
     if (is_array($config)) {
         $this->config = new Config($config);
     } else {
         if ($config instanceof Config) {
             $this->config = $config;
         } else {
             throw new Exception('The project config must be either an array or an instance of Pop\\Config.');
         }
     }
     return $this;
 }