li3_behaviors\data\model\Behavior::config()

public method

Gets/sets the configuration, allows for introspecting and changing behavior configuration.

Parameters

  • string|array $key

    A configuration key or if null (default) returns whole configuration. If array will merge config values with existing.

  • mixed $value

    Configuration value if null (default) will return $key.

Returns

array|string

Configuration array or configuration option value if $key was string.

Source

	public function config($key = null, $value = null) {
		if (is_array($key)) {
			return $this->_config = $key + $this->_config;
		}
		if ($key === null) {
			return $this->_config;
		}
		if ($value !== null) {
			return $this->_config[$key] = $value;
		}
		return isset($this->_config[$key]) ? $this->_config[$key] : null;
	}