Sets a relationship value.

@param   string      $key
@param   Model|null  $value
@return  self
971613
protected function setRelationship($key, $value)
    {
        if (true === $this->isHasOne($key)) {
            return $this->setHasOne($key, $value);
        }
        if (true === $this->isHasMany($key)) {
            throw new \RuntimeException('You cannot set a hasMany relationship directly. Please access using push(), clear(), and/or remove()');
        }
        return $this;
    }
179053
private function set($key, $value): self
    {
        array_set($this->charts[$this->name], $key, $value);

        return $this;
    }
387244
public function set($key, $value)
    {
        $hash = $this->key_to_hash($key);
        $this->array[$hash] = $value;
        return $this;
    }
1198646
public function set(string $key, $value): self
    {
        $this->data[$key] = $value;

        return $this;
    }
698147
public function set($key, $value = null)
    {
        $data = is_array($key) ? $key : [$key => $value];
        $obj = self::instance();
        $obj->fill($data);
        return $obj->save();
    }
961836
public function set($key, $value)
    {
        if (is_null($value)) {
            $value = 'NULL';
        } else if (is_bool($value)) {
            $value = $value ? 'TRUE' : 'FALSE';
        }
        
        $this->set[$key] = $value;
        
        return $this;
    }
1365503
public function set($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $name => $value)
            {
                $this->_data[$name] = $value;
            }
        }
        else
        {
            $this->_data[$key] = $value;
        }

        return $this;
    }
949988
public function setParameter(string $key, $value): self
    {
        $this->parameters->set($key, $value);

        return $this;
    }
646878
public function set(string $key, $value): self
    {
        Arr::set($this->data, $key, $value, true);
        return $this;
    }
192100
public function set($key, $value) {
    if ($this->exists($key)) {
      $index = $this->getKeyPosition($key);
      $this->values[$index] = $value;
      return $this;
    }
    return $this->add($key, $value);
  }
1151340
public function set($key, $value)
    {
        $allowed = array_diff(array_keys(get_class_vars(get_class($this))), $this->_hidden);
        if (empty($allowed) || !empty($allowed) && in_array($key, $allowed)) {
            if (method_exists($this, 'set' . ucfirst($key))) {
                call_user_func_array([$this, 'set' . ucfirst($key)], [$value]);
            } else {
                $this->{$key} = self::modelize($key, $value);
            }
        }

        return $this;
    }
987830
public function set($key, $value = null)
    {
        $data = is_array($key) ? $key : [$key => $value];

        foreach ($data as $key => $value) {
            Arr::set($_SESSION, $key, $value);
        }

        return $this;
    }
1000603
public function add($key, $value = null)
    {
        $this->_view->with($key, $value);

        return $this;
    }
523987
public function set(string $key, $value = true) : self
    {
        $this->attributes[$key] = $value;

        return $this;
    }
1106261
public function set($key, $value = null)
    {
        if (!$this->offsetExists($key)) {
            $this->storage[$key] = $value;
        }

        return $this;
    }
1372540
public function set($key, $value = null)
    {
        if (is_array($key)) {
            $this->global_data = array_merge($this->global_data, $key);
        } else {
            $this->global_data[$key] = $value;
        }

        return $this;
    }
807447
public function send($key, $value = null) {
        $this->getView()->set($key, $value);
        return $this;
    }