Adds a value to a collection, collection will be created if it does not already exist
@param string $key The collection key
@param $value
335160
public function add($key, $value) {
		$this->validateValue($value);
		if (!isset($this->variables[$key])) {
			$this->variables[$key] = [];
		}

		if (!is_array($this->variables[$key])) {
			$this->variables[$key] = [$this->variables[$key]];
		}

		$this->variables[$key][] = $value;
	}
1031573
public function set($key, $value=null)
    {
        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } elseif ($key instanceof Collection) {
            $this->set($key->all());
        } elseif (is_scalar($key)) {
            $this->data[$key] = $value;
        }
        
        return $this;
    }
921724
protected function add($style, $key, $value)
    {
        $this->style[$style]->add($key, $value);

        // If we are adding a color, make sure it gets added
        // as a background color too
        if ($style == 'color') {
            $this->style['background']->add($key, $value);
        }
    }
1263479
public function add($key, $value) {
        $node = new Node();
        $node->setKey($key);
        $node->setValue($value);
        $this->append($node);
    }
1162148
public function set($key, $value)
    {
        $this->nestedKeyCache = [];

        if ($this->isNestedKey($key)) {
            $this->setNestedValueByKey($key, $value);

            return;
        }

        $this->items[$key] = $value;
    }
679499
public function set($key, $value)
    {
        $this->assertElementIsOfType($value);

        $this->collection->set($key, $value);
    }
706900
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $configKey => $configValue) {
                $this->setSingleItem($configKey, $configValue);
            }
        } else {
            $this->setSingleItem($key, $value);
        }
    }
125946
public
    function add(
        $value = null,
        $key = ''
    ) {
        //var_dump($this->type);
        //var_dump($value);
        //var_dump(is_object($value));
        //die;

        if ($this->isClass) {
            //echo "  isClass".PHP_EOL;
            if (!is_a($value, $this->type)) {
                //throw new TypeCheckException('Object type "'.get_class($value).'" is not of type "'.$this->type.'".');
                $type = is_object($value) ? get_class($value) : gettype($value);
                throw new TypeCheckException('Object type "'.$type.'" is not of type "'.$this->type.'".');
            } else {
                // add to collection
                if ($key != '') {
                    if (array_key_exists($key, $this->collection)) {
                        throw new ArgumentException(
                            'Can not add object to key "'.$key.'", because key already exists.'
                        );
                    } else {
                        $this->collection[$key] = $value;
                    }
                } else {
                    array_push($this->collection, $value);
                }
            }
        } else {
            //echo "  noClass".PHP_EOL;
            if ($this->type == gettype($value)) {
                // add to collection
                if ($key != '') {
                    if (array_key_exists($key, $this->collection)) {
                        throw new ArgumentException('Can not add value to key "'.$key.'", because key already exists.');
                    } else {
                        $this->collection[$key] = $value;
                    }
                } else {
                    array_push($this->collection, $value);
                }
            } else {
                throw new TypeCheckException('Value type "'.gettype($value).'" is not of type "'.$this->type.'".');
            }
        }
    }
934175
public static function add($key, $value)
    {
        if (!isset(self::$config[$key]) || !is_array(self::$config[$key])) {
            return false;
        }
        array_push(self::$config[$key], $value);
        return true;
    }
318103
public function add($key, $value)
    {
        if (!$key) {
            return $this;
        }

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

        return $this;
    }
1351370
public function add($key, $value = null) : void
    {
        if (is_array($key)) {
            $this->storage  = array_replace_recursive($this->storage, $key);
        } elseif ($value !== null) {
            $key = $this->getCompositeKey($key);
            ArrayHelper::set($this->storage, $key, $value);
        }
    }
532817
public function add( $key, $value ) {
		if ( ! array_key_exists( $key, $this->attributes ) ) {
			$this->attributes[ $key ] = $value;
		} else {
			if ( ! \is_array( $this->attributes[ $key ] ) ) {
				$this->attributes[ $key ] = array( $this->attributes[ $key ], $value );
			} else {
				$this->attributes[ $key ][] = $value;
			}
		}
	}
392449
public function setKey($collection, $key, $value) {

        $entry = $this->driver->findOne($collection, ['key' => $key]);

        if ($entry) {
            $entry['val'] = $value;
        } else {
            $entry = [
                'key' => $key,
                'val' => $value
            ];
        }

        return $this->driver->save($collection, $entry);
    }
1081980
public function set($key, $value)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $array =& $this->_items;
            foreach (explode('.', $key) as $v)
                $array =& $array[$v];
            $array = $value;
        } else {
            $this->_items[$key] = $value;
        }
    }
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;
        }
    }
418908
public void putValue(K key, V value) {
		Collection<V> collection = this.get(key);
		if (null == collection) {
			collection = createCollction();
			this.put(key, collection);
		}
		collection.add(value);
	}
1222596
public function add($key, $value)
    {
        if (!is_null($value)) {
            $this->data[$key] = $value;
        }

        return $this;
    }