Sets a string in an array.

@param array  &$valueArray The array of a set of values
@param string $key         The key of the key value pair
@param string $value       The value of the key value pair
517701
public function setValueArrayString(array &$valueArray, $key, $value)
    {
        Validate::isString($key, 'key');

        if (!empty($value)) {
            Validate::isString($value, 'value');
            $valueArray[$key] = $value;
        }
    }
1202588
public function set($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (is_array($value))
        {
            throw new Exception('Must use setArray() or setAssociativeArray() for this value.');
        }
        $this->_performOperation($key, new SetOperation($value));
    }
839919
public static function set(array &$array, $key, $value, array $tests = []) {
        foreach ($tests as $current) {
            if ($current !== $value) {
                continue;
            }
            return;
        }
        $array[$key] = $value;
    }
827449
final public function setValues(array $values) {
		if (is_array($values)) {
			foreach (array_keys($this->toArray()) as $key) {
				if (array_key_exists($key, $values)) {
					ObjectMixin::set($this, $key, $values[$key]);
				}
			}
		}
	}
555999
public static function set($key, $value)
    {
        if (is_array($key)) {
            $now = self::self()->getContainer()['settings'];
            foreach ($key as $item) {
                $now = $now[$item];
            }
            $now = $value;
        } else {
            $settings = self::self()->getContainer()['settings'];
            $settings[$key] = $value;
        }
    }
696020
public function setJson($key, $value = null): void
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setJson($k, $v);
            }
            return;
        }

        $this->_jsonData[$key] = $value;
    }
873108
private function _setArray($key, $val) {
		preg_match("/<loop\." . $key . ">(.*?)<\/loop\." . $key . ">/s", $this->_result, $l);
		
		$loop_content = '';
		$loop = $l[1];
		foreach ($val as $v) {
			$loop_replaced = $loop;
			foreach ($v as $x => $y) {
				$loop_replaced = str_replace('{{' . $key . '.' . $x . '}}', $y, $loop_replaced);
			}
			$loop_content.= $loop_replaced;
		}
		
		$this->_result = preg_replace("/<loop\." . $key . ">(.*?)<\/loop\." . $key . ">/s", preg_quote($loop_content), $this->_result);
		$this->_result = stripslashes($this->_result);

		$this->_result = str_replace("<loop." . $key . ">", '', $this->_result);
		$this->_result = str_replace("</loop." . $key . ">", '', $this->_result);
	}
1183960
private static function setArrayValue(&$root, $compositeKey, $value)
    {
        $keys = explode('.', $compositeKey);
        while (count($keys) > 1) {
            $key = array_shift($keys);
            if (!isset($root[$key])) {
                $root[$key] = [];
            }
            $root = &$root[$key];
        }

        $key = reset($keys);
        $root[$key] = $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);
            }
        }
    }
520430
public function setAssociativeArray($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (!is_array($value))
        {
            throw new Exception('Must use set() for non-array values.');
        }
        $this->_performOperation($key, new SetOperation($value, true));
    }
285766
public function offsetSet($key, $value)
    {
        if (Arr::accessible($this->value)) {
            $this->value[$key] = $value;
        }
    }
1253319
public function set(string $key, $value): void
    {
        Arr::set($this->items, $key, $value, true);
    }
159720
function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
1076180
public function setParams( $key, $value = '' ) {
		//if (!isset($this->params)) $this->params = array();

		if ( is_array( $key ) ) {
			self::$RealParams = $key;
		} else {
			self::$RealParams[ $key ] = $value;
		}

	}
771154
public function set($key, $value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }
        parent::set($this->normalizeKey($key), [
            'value' => $value,
            'originalKey' => $key
        ]);
    }
1003295
function setValues (array $values = array())
    {
        foreach ($this->getFields() as $field)
            if (array_key_exists($field->getName(), $values))
                $field->setValue($values[$field->getName()]);
        foreach ($this->dataFields as $dataKey => $dataVal)
            if (array_key_exists($dataKey, $values))
                $this->dataFields[$dataKey] = $values[$dataKey];
    }
434089
protected function setOption(&$array, $key, $var, $value = null)
    {
        $value = ($value === null) ? $var : $value;

        if (!empty($var)) {
            $array[$key] = $value;
        }

        return $array;
    }