Set a schema field.

@param string|array $path The JSON schema path of the field with parts separated by slashes.
@param mixed $value The new value.
@return $this
779682
public function setField($path, $value) {
        if (is_string($path)) {
            if (strpos($path, '.') !== false && strpos($path, '/') === false) {
                trigger_error('Field selectors must be separated by "/" instead of "."', E_USER_DEPRECATED);
                $path = explode('.', $path);
            } else {
                $path = explode('/', $path);
            }
        }

        $selection = &$this->schema;
        foreach ($path as $i => $subSelector) {
            if (is_array($selection)) {
                if (!isset($selection[$subSelector])) {
                    $selection[$subSelector] = [];
                }
            } elseif ($selection instanceof Schema) {
                $selection->setField(array_slice($path, $i), $value);
                return $this;
            } else {
                $selection = [$subSelector => []];
            }
            $selection = &$selection[$subSelector];
        }

        $selection = $value;
        return $this;
    }
346017
public function fieldValue($field, $value)
    {
        if (!in_array($field, $this->supports)) {
            $this->supports[ ] = $field;
        }
        $this->values[ $field ] = $value;

        return $this;
    }
941477
public function set($path, $value)
	{
		$result = null;

		/**
		 * Explode the registry path into an array and remove empty
		 * nodes that occur as a result of a double dot. ex: joomla..test
		 * Finally, re-key the array so they are sequential.
		 */
		$nodes = array_values(array_filter(explode('.', $path), 'strlen'));

		if ($nodes)
		{
			// Initialize the current node to be the registry root.
			$node = $this->data;

			// Traverse the registry to find the correct node for the result.
			for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++)
			{
				if (!isset($node->$nodes[$i]) && ($i != $n))
				{
					$node->$nodes[$i] = new \stdClass;
				}

				$node = $node->$nodes[$i];
			}

			// Get the old value if exists so we can return it
			$result = $node->$nodes[$i] = $value;
		}

		return $result;
	}
419018
public function set( $path, $value )
	{
		$path = trim( $path, '/' );

		$this->_getObject()->set( $path, $value );

		apc_store( $this->_prefix . $path, $value );
	}
1304671
public static function setValue(&$array, $key, $value)
    {
        if (is_string($key)) {
            // Iterate path
            $keys = explode('.', $key);
            foreach ($keys as $key) {
                if (!isset($array[$key]) || !is_array($array[$key])) {
                    $array[$key] = [];
                }
                $array = &$array[$key];
            }
            // Set value to path
            $array = $value;
        } elseif (is_array($key)) {
            // Iterate array of paths and values
            foreach ($key as $k => $v) {
                self::setValue($array, $k, $v);
            }
        }
    }
389890
public function set($key, $value)
    {
        $path = explode(".", $key);
        $obj = $this->payload;
        $last = count($path) - 1;
        foreach ($path as $i => $item) {
            if ($i === $last) {
                $obj->$item = $this->toStdClass($value);
            } else {
                $obj = $obj->$item;
            }
        }
        return $this;
    }
492108
public function withAddedValue($path, $value)
    {
        $new = clone $this;
        if ($new->isExpanded === false) {
            $new->value = $new->_expand($new->value);
        }
        $new->value = Hash::insert($new->value, $path, $value);

        return $new;
    }
412089
public function setIn($key, $path, $value, $push = false)
    {
        $this->prepareSet($key);

        $target = $this->get($key);
        $path = (array) $path;

        if (!is_array($target)) {
            throw new Exception\UnexpectedPropertyValueException(get_class($this) . ": Property {$key} is not complex type");
        }

        \Owl\array_set_in($target, $path, $value, $push);
        $this->change($key, $target);

        return $this;
    }
224075
public function set($path, $value)
    {
        list($name, $path) = $this->splitPath($path);

        if (empty($path)) {
            throw new RuntimeException('The root node of config is not writable');
        }

        return $this->load($name)->set($path, $value);
    }
1242238
public function set($path = null, $value = null)
	{
		if ($path === null) {
            $this->data = $value;
            return $this;
        }

        $at       =& $this->data;
        $keys     = explode(".", $path);
        $keyCount = count($keys);

        for ($i=0; $i < $keyCount; $i++) {
            if (($keyCount-1) === $i) {
                if (is_array($at)) {
                    $at[$keys[$i]] = $value;
                } else {
                    throw new \RuntimeException("Can not set value at this path ($path) because is not array.");
                }
            } else {
                $key = $keys[$i];
                if (!isset($at[$key])) {
                    $at[$key] = [];
                }
                $at =& $at[$key];
            }
        }

        return $this;
	}
472218
public function setPath($path)
	{
		if($path !== false)
			$path = trim($path, '/');

		$this->setProperty('path', $path);

		return $this;
	}
1354753
public function replace($path, $value)
    {
        $this->operations[] = [
            "op" => PatcherInterface::REPLACE_OPERATION,
            "path" => $path,
            "value" => $value,
        ];

        return $this;
    }
845921
public function set($path, $value)
    {
        $parts = explode('.', $path);
        switch (count($parts)) {
            case 2:
                $this->_data[$parts[0]][$parts[1]] = $value;
                break;
            case 1:
                $this->_data[$parts[0]] = $value;
                break;
            case 0:
                throw new RuntimeException('Path was empty.');
            default:
                throw new RuntimeException('Too many parts in path.');
        }
    }
1240928
protected function setAsInteger($field, $value)
    {
        if (in_array($field, $this->getColumns()) && (
                !array_key_exists($field, $this->object) ||
                $this->object[$field] !== $value
        )) {
            $this->dirtyFields[$field] = true;
        }
        $this->object[$field] = (int) $value;

        return $this;
    }
152646
public function setRaw($path, $value)
    {
        StructureHelper::setByPath($this->data, $path, $value, $this->separator);

        return $this;
    }
738563
public function set($path, $value)
    {
        PropertyAccessor::setByPath($this->values, $this->path($path), $value);
    }
1215165
protected function SetJSFieldValue($field, $value)
    {
        $jsField = Str::ToJavascript($field, false);
        $jsValue = Str::ToJavascript($value, false);
        echo "<script>$($jsField).val($jsValue);</script>";
    }