Set the value of $key. If $key is the name of a relation, the
relation will associated with this entity.

@param string $key   The name of the key to set.
@param mixed  $value The value to set.
191333
public function setRaw($key, $value)
    {
        if (isset(static::$relations[$key])) {
            return $this->associateRelation($key, $value);
        }

        //apply the modified flag if the key is one of the fields and
        //the value has changed
        if (in_array($key, static::$fields) && $value !== $this->getRaw($key)) {
            $this->modified[$key] = true;
        }
        $this->values[$key] = $value;
    }
916203
public function set($key, $value)
    {
        $connection = Yii::$app->db;

        if (isset($this->settings[$key])) {
            $connection->createCommand()->update('settings', ['value' => $value])->execute();
        } else {
            $connection->createCommand()->insert('settings', [
                'key' => $key,
                'value' => $value,
            ])->execute();
        }

        $this->settings[$key] = $value;
    }
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;
        }
    }
1355718
public function set($key, $value)
    {
        $setting = SettingModel::create(
            [
                'key' => $key,
                'value' => $value,
            ]
        );

        return $setting ? $value : false;
    }
605038
public function set($key, $value)
    {
        Assume::that(is_scalar($key));
        if (isset($this->emptySubset)) {
            $this->createTrueSubset();
        }
        $oldValue = null;
        if (isset($this->data[$key])) {
            $oldValue = $this->data[$key];
        }
        if (isset($key) and isset($value) and $key !== '') {
            $this->data[$key] = $value;
        } else {
            $this->data[$key] = null;
        }
        if (! $this->root->updated and $oldValue !== $value) {
            $this->root->updated = true;
            $this->root->update();
        }
    }
436772
public function set(string $key, $value)
    {
        if (! is_array($value)) {
            $value = [$value];
        }

        parent::set($key, [
            'value' => $value,
            'originalKey' => $key
        ]);
    }
564152
public function set($key, $value)
    {
        if ($config = $this->getConfigFor($key)) {
            if ($type = Arr::get($config, 'type')) {
                @settype($value, $type);
            }
            $this->setting->set($key, $value);
        }
    }
912697
public function setRelationship($value, $key = '')
	{
		if (is_array($value)) {

			$class = __NAMESPACE__ . '\\' . str_singular($key);

			if (class_exists($class)) {

				// Check to see if the key value is plural or singular
				// if it is plural then we create a collection
				// otherwise we instantiate the class and add a single item to the relationship
				if (str_singular($key) == $key) {
					$this->addRelationship(new $class($value));
				}
				else {
					$collection = $class::newCollection($value);
					$this->addRelationship($collection);
				}
			}
		}
		elseif ($value instanceof Collection) {
			$this->addRelationship($value);
		}
		elseif ($value instanceof BaseModel) {
			$this->addRelationship($value);
		}
	}
906786
public function set($key, $value) {
		$this->loadIfNeeded();

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

		$this->saver->save($this->fileName, $this->array, $this->fileMap);
	}
511721
public function setValue($key, $value)
    {
        $this->langstrings[$key] = $value;
        $this->debug('SetValue ' . $key . ' => ' . $value);
    }
547244
protected function setData($key, $value)
    {
        $this->data[$key] = (is_array($value)) ? $value : [$value];
    }
1252275
public function setParam($key, $value)
    {
        if (null === $this->params) {
            $this->params = array();
        }

        $this->params[$key] = $value;
    }
347815
public function set($key, $value = null)
    {
        DotArr::set($this->data, $key, $value);
    }
679499
public function set($key, $value)
    {
        $this->assertElementIsOfType($value);

        $this->collection->set($key, $value);
    }
1170565
public function set(string $key, $value)
    {
        parent::set(Formater::normalize($key), [
            'key' => $key,
            'value' => $value
        ]);
    }
429846
public function set($key, $value = null)
    {
        if( is_array($key) ) {
            $this->values($key);
        } else {
            $this->value($key, $value);
        }
        return $this;
    }
153671
public function set($key, $value)
    {
        $this->setScope($key, true);
        parent::set($key, $value);
        /** @noinspection PhpInternalEntityUsedInspection */
        $this->key = null;
    }