Sets the given data on the specified key.

@param mixed $key name of key to set
@param mixed $data data to set for the given key

@return void

@throws RuntimeException on write attempt when modification is forbidden
326868
public function offsetSet($key, $data)
    {
        if (!$this->allow_modification) {
            throw new RuntimeException('Attempting to write to an immutable array');
        }

        if (isset($data) && is_array($data)) {
            $data = new static($data);
        }

        return parent::offsetSet($key, $data);
    }
1012098
protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
300542
public function updateByPrimaryKey($key, array $data)
    {
        $this->updateByField($this->entity->getPrimaryKey(), $key, $data);
    }
77817
public function setData($data)
    {
        $this->originalData = $data;

        if ($data instanceof \Iterator) {
            $this->iterator = $data;
        }
        elseif (is_array($data)) {
            $this->iterator = new \ArrayIterator($data);
        }
        else {
            $this->iterator = new \ArrayIterator(array($data));
        }
    }
1277518
public static function set($data, $keys, $value)
    {
        return self::instance()->setValue($data, $keys, $value);
    }
944207
public function setData($data)
    {
        if(!$this->getIsValidData($data))
        {
            throw new InvalidDataException();
        }

        if(!$this->getIsAllKeysValid($data))
        {
            throw new InvalidKeyException();
        }

        if(!$this->getIsAllValuesValid($data))
        {
            throw new InvalidValueException();
        }

        $this->__data = $data;
        $this->invalidateKeycache();
    }
858757
private function setData($data) {
        $this->indcheck = $data[0];
        $this->data = $data[1];
        $this->calculateChecksum();
        $this->data[] = $this->code[$this->checksumValue];
        $this->data[] = $this->code[self::KEY_STOP];
    }
23730
public function setTemplate(array $data, string $key): void
  {
    $this->templateData = $data;
    $this->templateKey  = $key;
  }
601250
public function setRawData($data)
	{
		if (is_string($data)) {
			$this->rawData(true);
			$this->dataRaw = $data;
		} else {
			throw new RuntimeException('Invalid RAW data setted.');
		}
		
		return $this;
	}
115708
public function updatePreferences(string $key, $data)
    {
        $current = $this->preferences;

        $this->preferences = PreferencesParser::parse($current)->update($key, $data)->toJson();

        $this->save();
    }
1272823
protected function set($key, $data, $expire) {
		$this->memcache->set($key, $data, null, $expire);
	}
989965
public function set($key, $data)
    {
        $file = $this->getFilePath($key);

        if ($handle = fopen($file, 'w')) {
            fwrite($handle, $data);
            fclose($handle);
        }
    }
895963
public function setData($key, $value = null)
    {
        if (is_array($key)) {
            $this->_data = $key;
        } else {
            $this->_data[$key] = $value;
        }

        return $this;
    }
547244
protected function setData($key, $value)
    {
        $this->data[$key] = (is_array($value)) ? $value : [$value];
    }
1025485
public function put($key, $data)
    {

        $key = $this->getKeyCode($key);
        $data = json_encode($data);
        $this->memcacheObj->set($key, $data);
    }
941850
public function appendData($key, $data)
    {
        $this->_putData($key, $data);

        if ($this->_objectCreation) {
            return $this->_afterAppendDataToNewObject();
        }
        return $this;
    }
1357525
public function set($key, $value) {
		if (null === $key) {
			$this->_data[] = $value;
		} else {
			$this->_data[$key] = $value;
		}
	}