Set Value for Field

@param   string     $key
@param   object     $data
@param   null|mixed $default

@return  stdClass
@since   1.0.0
559280
protected function setFieldValue($key, $data, $default = null)
    {
        $value = null;

        if (isset($data->$key)) {
            $value = $data->$key;
        }

        if ($value === null) {
            $value = $default;
        }

        return $value;
    }
1054602
public function set($key, $data) {
        if ($this->clustered) {
            $status = true;
            foreach ($this->setconnections as $connection) {
                $status = $connection->set($key, $data, $this->definition->get_ttl()) && $status;
            }
            return $status;
        }

        return $this->connection->set($key, $data, $this->definition->get_ttl());
    }
388446
public function setData($key, $value){

        $key = $this->normalizeKeyName($key);

        if( isset($this->_data[$key]) ){
            if( $this->_data[$key] !== $value ){
                $this->_original[$key] = $this->_data[$key];
                $this->_changes[$key] = $value;
            }
        }else{
            $this->_changes[$key] = $value;
        }

        $this->_data[$key] = $value;

        return $this;
    }
895963
public function setData($key, $value = null)
    {
        if (is_array($key)) {
            $this->_data = $key;
        } else {
            $this->_data[$key] = $value;
        }

        return $this;
    }
873666
public function get($key = null, $default = null)
	{
		$return = $this->data;

		if ($key !== null) {
			$keys = explode('.', $key);

			foreach ($keys as $key) {
				if (isset($return[(string) $key])) {
					$return = $return[$key];
				} else {
					$return = $default;
					break;
				}
			}
		}

		return $return;
	}
857648
private function getProperty(array $data, $key, $default = null)
    {
        return array_key_exists($key, $data) && $data[$key] !== null ? $data[$key] : $default;
    }
1044462
public function get($key, $default = null)
	{
        $value = $this->settings;
        $value = set_nested_array_value($value, $key);

        if ( ! is_null($value))
        {
            return $value;
        }

        return $default;
	}
244762
public function attr($key = null, $default = null)
    {
        return is_null($key) ? $this->attributes : array_get($this->attributes, $key, $default);
    }
1246106
public function get($key, $default = null)
    {
        $data = Arr::get($this->config, $key);

        if ($data === null) {
            $data = is_array($default) ? new self($default) : $default;
        }

        return $data;
    }
490596
private static function recursiveGetFromKey($data, $key, $default)
    {
        if (empty($key)) {
            return $data;
        } else {
            $currentKey = array_shift($key);
            return isset($data[$currentKey]) ? self::recursiveGetFromKey($data[$currentKey], $key, $default) : $default;
        }
    }
993977
public function getField($name, $key, $default = null)
    {
        if (array_key_exists($name, $this->fields) && array_key_exists($key, $this->fields[$name])) {
            return $this->fields[$name][$key];
        }
        return $default;
    }
817714
public function set($key, $data = null)
    {
        if (is_array($key)) {
            $this->appendArray($key);
        } else {
            $this->appendData($key, $data);
        }

        return $this;
    }
59859
public function get($key, $default = null)
    {
        if (array_key_exists($key, $this->data)) {
            return $this->data[$key];
        }

        $value = $default;
        if ($this->isDotNotation($key)) {
            $keys = explode('.', $key);
            $value = $this->data;

            foreach ($keys as $segment) {
                if (!is_array($value) || !array_key_exists($segment, $value)) {
                    $value = $default;
                    break;
                }

                $value = $value[$segment];
            }
        }

        return $value;
    }
1002446
public function getData($key = null, $default = null)
    {
        if (!isset($key)) {
            return $this->data;
        }

        $result = gplcart_array_get($this->data, $key);
        return isset($result) ? $result : $default;
    }
1144920
public function setDefaultData($key, $val = null)
    {
        if(is_array($key))
        {
            foreach($key as $k=>$v)
            {
                $this->setDefaultData($k, $v);
            }
        }
        else
        {
            $this->defaultData[$key] = $val;
        }

        return $this;
    }
812725
public function config(string $key = null, $default = null)
    {
        $key = $key ? sprintf('%s.%s', $this->getId(), $key) : $this->getId();

        return config($key, $default);
    }
273357
public function get($key, $default = null)
    {
        $key = $this->resolveAlias($key);

        $accessor = 'get' . $this->toCamelCase($key) . 'Value';

        $value = isset($this->data[$key]) ? $this->data[$key] : null;

        if (is_callable([$this, $accessor])) {
            return $this->$accessor($value);
        }

        if ($cast = $this->getCast($key)) {
            $value = $this->castValue($key, $value);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }