Esempio n. 1
0
 /**
  * @param string $key
  * @param mixed  $value
  * @param string $group
  * @param string $type
  * @return AppData
  */
 public function set($key, $value, $group = 'default', $type = null)
 {
     $group = $this->_clean($group);
     $group = empty($group) ? 'default' : $group;
     $key = $this->_clean($key);
     $type = empty($type) ? $this->_getType($value) : $type;
     // create sql replace query
     $sql = $this->_getSelect()->replace(ZOO_TABLE_JBZOO_CONFIG)->values('group', $group)->values('key', $key)->values('value', $this->_prepareValue($value, $type))->values('type', $type);
     // insert new data
     $this->sqlQuery($sql);
     // update data in memory
     if ($type == self::TYPE_DATA) {
         $value = $this->app->data->create($value);
     }
     $this->_configs->set($group . '.' . $key, $value);
 }
Esempio n. 2
0
 /**
  * Modifies a property of the object, creating it if it does not already exist.
  *
  * @param string $property The name of the property
  * @param mixed $value The value of the property
  *
  * @return mixed The previous value of the property
  *
  * @since 1.0.0
  */
 public function set($property, $value = null)
 {
     return $this->_params->set($property, $value);
 }
Esempio n. 3
0
 /**
  * Magic method to set a configuration value
  *
  * @param string $name  The configuration key
  * @param mixed  $value The value to set
  *
  * @since 2.0
  */
 public function __set($name, $value)
 {
     $this->config->set($name, $value);
 }
Esempio n. 4
0
 /**
  * Sets the elements data.
  * @param $key
  * @param $value
  * @return $this
  */
 public function set($key, $value)
 {
     $this->_data->set($key, $value);
     return $this;
 }