Beispiel #1
0
 /**
  * Set config value partially of completely
  * @param $name
  * @param $value
  * @return $this
  */
 public function setConfig($name, $value)
 {
     if (is_null($name)) {
         $this->_config = new ArrayStorage($value);
     } else {
         $this->_config->setDeepValue($name, $value);
     }
     return $this;
 }
Beispiel #2
0
 /**
  * @param $data
  * @changed
  * @param null $deepKey
  */
 public static function setConfig($data, $deepKey = null)
 {
     if (empty(self::$_config)) {
         self::$_config = new ArrayStorage();
     }
     if ($deepKey) {
         self::$_config->setDeepValue($deepKey, $data);
     } else {
         self::$_config->setData($data);
     }
 }
Beispiel #3
0
 public function updateAbilityInfo($name, $info)
 {
     $currentInfo = $this->getAbilityInfo($name);
     foreach ($info as $key => $value) {
         $currentInfo[$key] = $value;
     }
     $this->_data->setDeepValue('abilities/' . $name, $currentInfo);
     return $this;
 }
Beispiel #4
0
 public function setVar($key, $value, $format = null)
 {
     if ($format) {
         $this->_formatVars->setDeepValue($format . '/' . $key, $value);
     } else {
         $this->_vars->setDeepValue($key, $value);
     }
     return $this;
 }
Beispiel #5
0
 public function set($deepKey, $value, $toEnvironment = null)
 {
     //@todo hasDeepKey
     if ($this->_environmentData && ($this->_environmentData->hasDeep($deepKey) && $toEnvironment !== false) || $toEnvironment === true) {
         $this->_environmentData->setDeepValue($deepKey, $value);
     } else {
         $this->_originalData->setDeepValue($deepKey, $value);
     }
     $this->_combinedData->setDeepValue($deepKey, $value);
     return $this;
 }
Beispiel #6
0
 public function __call($method, $params)
 {
     $operation = substr($method, 0, 3);
     if (in_array($operation, array('get', 'set'))) {
         if (substr($method, -4) == 'Root') {
             $key = 'roots/' . strtolower(substr($method, 3, -4));
         } else {
             $key = strtolower(substr($method, 3));
         }
         if ($operation == 'get') {
             return $this->_vars->getDeepValue($key);
         } else {
             $this->_vars->setDeepValue($key, $params[0]);
             DC::getEventDispatcher()->dispatchEvent('environment.update', $key);
             return $this;
         }
     } else {
         return $this;
     }
 }
Beispiel #7
0
 public function setVar($name, $value)
 {
     $this->_vars->setDeepValue($name, $value);
     return $this;
 }