@param String   $key
@param DateTime $value

@return $this

@throws Exception\PropertyException
172285
public function setDate($key, DateTime $value)
    {
        $this->set(self::DATE, $key, $value);

        return $this;
    }
1121922
public function setAttribute($key, $value)
    {
        // First we will check for the presence of a mutator for the set operation
        // which simply lets the developers tweak the attribute as it is set on
        // the model, such as "json_encoding" an listing of data for storage.
        if ($this->hasSetMutator($key)) {
            $method = 'set' . Str::studly($key) . 'Attribute';

            return $this->{$method}($value);
        }

        // If an attribute is listed as a "date", we'll convert it from a DateTime
        // instance into a form proper for storage on the database tables using
        // the connection grammar's date format. We will auto set the values.
        if ($value && $this->isDateAttribute($key)) {
            $value = $this->fromDateTime($value);
        }

        if ($this->isJsonCastable($key) && !is_null($value)) {
            $value = $this->asJson($value);
        }

        // If this attribute contains a JSON ->, we'll set the proper value in the
        // attribute's underlying array. This takes care of properly nesting an
        // attribute in the array's value in the case of deeply nested items.
        if (Str::contains($key, '->')) {
            return $this->fillJsonAttribute($key, $value);
        }

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

        return $this;
    }
1208366
public function set($key, $value, $ttl = null)
    {
        if ($ttl) {
            $ttl = $ttl->getTimestamp() - (new \DateTime('now', new \DateTimeZone('UTC')))->getTimestamp();
            $this->getRedis()->setex($key, $ttl, $value);
        } else {
            $this->getRedis()->set($key, $value);
        }

        return $this;
    }
1321171
public function setDateTime($dateTime)
	{
		$this->registry()->register(self::REGISTRY_DATETIME, $dateTime, true);
		return $this;
	}
972186
public function addCookie(string $key, $value, \DateTimeInterface $expire)
    {
        $this->cookies[$key] = $this->cookieFactory->build($key, $value, $expire);
    }
1042172
public function dateFrom(\DateTime $value)
    {
        $this->add(new Criterium(self::CRITERIUM_START_DATE, $value));

        return $this;
    }
1151069
public function setAttribute($key, $value)
	{
		// First we will check for the presence of a mutator for the set operation
		// which simply lets the developers tweak the attribute as it is set on
		// the model, such as "json_encoding" an listing of data for storage.
		if ($this->hasSetMutator($key)) {
			$method = 'set' . Str::studly($key) . 'Attribute';

			return $this->{$method}($value);
		}

		// If an attribute is listed as a "date", we'll convert it from a DateTime
		// instance into a form proper for storage on the database tables using
		// the connection grammar's date format. We will auto set the values.
		elseif (in_array($key, $this->getDates()) && $value) {
			$value = $this->fromDateTime($value);
		}

		// Only set if the user can currently access
		if ($this->console_mode || $this->modify_authorizer->canAccess($key)) {
			if ($this->isJsonCastable($key) && ! is_null($value)) {
				$value = json_encode($value);
			}

			$this->attributes[$key] = $value;
		}
	}
1092700
protected function getDateTime($value)
    {
        try {
            if ($this->isTestingRelativeDateTime($value)) {
                return Date::parse($value);
            }

            return new DateTime($value);
        } catch (Exception $e) {
            //
        }
    }
486404
protected function setProperty($key, $property, $value = null)
    {
        // Can't be changed
        if ($key[0] === '@') {
            return $this->properties[$key] = $property;
        }

        // If the attribute has a get mutator, we will call that
        // then return what it returns as the value.
        if ($this->hasGetMutator($key)) {
            return $this->properties[$key] = $this->mutateAttribute($key, $value);
        }

        // Format date and time to UTC
        if ($value instanceof DateTime) {
            return $this->properties[$key] = $value->format('Y-m-d\TH:i:s');
        }

        // Set nested context
        if ($value instanceof Context) {
            return $this->properties[$key] = $this->filterNestedContext($value->getProperties());
        }

        // Set nested context from class
        if ($property && class_exists($property)) {
            return $this->properties[$key] = $this->getNestedContext($property, $value);
        }

        // Map properties to object
        if ($property !== null && is_array($property) && is_array($value)) {
            return $this->properties[$key] = $this->mapProperty($property, $value);
        }

        // Set value
        return $this->properties[$key] = $value;
    }
1254472
public function setAsActualType($key, $value)
    {
        $type = null;
        if (is_bool($value)) {
            $type = self::BOOLEAN;
        } elseif (is_int($value)) {
            $type = self::INT;
        } elseif (is_float($value)) {
            $type = self::FLOAT;
        } elseif (is_string($value)) {
            $type = strlen($value) > 255 ? self::DATA : self::STRING;
        } elseif ($value instanceof DateTime) {
            $type = self::DATE;
        } elseif ($value instanceof DOMDocument) {
            $type = self::XML;
        } elseif (is_array($value)) {
            $type = self::DATA_ARRAY;
        } elseif (is_object($value)) {
            $type = self::OBJECT;
        } else {
            $errMsg = 'Неизвестный тип';
            throw new Exception\PropertyException($errMsg);
        }

        $this->set($type, $key, $value);
    }
346335
public function hydrate($value)
    {
        if ($this->nullable && $value === null) {
            return null;
        }

        if (is_string($value) || is_int($value)) {
            if ($dateTime = DateTime::createFromFormat($this->getFormat(), $value)) {
                return $dateTime;
            }

            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid format or value: format must be a string representing a valid \DateTime format, "%s" given;' .
                'value must be a string representing the time according to \DateTime::createFromFormat(), "%s" given.',
                $this->getFormat(),
                $value
            ));
        }

        throw new Exception\InvalidArgumentException(sprintf(
            'Invalid value: must be a string or integer representing the time according to the format, "%s" given',
            is_object($value) ? get_class($value) : gettype($value)
        ));
    }
1261619
public function setBoolean($key, $value)
    {
        if (!settype($value, 'boolean')) {
            $errMsg = 'Ошибка при конвертации к типу bool';
            throw new Exception\PropertyException($errMsg);
        }
        $this->set(self::BOOLEAN, $key, $value);

        return $this;
    }
121855
public function set($key, $value) {
        $key = $this->getAbsoluteConfigKey($key);

        array_set($this->config, $key, $value);

        return $this;
    }
208850
protected function setParameter($key, $value)
    {
        if (null !== $this->response) {
            throw new RuntimeException('Request cannot be modified after it has been sent!');
        }
        $this->parameters->set($key, $value);

        return $this;
    }
173096
private function setValue(\DateTimeImmutable $value = null): void
    {
        if ($value === null) {
            $this->value = null;

            return;
        }

        $this->value = $value->setTime(0, 0, 0);
    }
19913
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = &$this->parameters;

        while (count($keys) > 1) {
            $pkey = $keys[0];

            if (!array_key_exists($pkey, $data) || !is_array($data[$pkey])) {
                $data[$pkey] = [];
            }

            $data = &$data[$pkey];
            array_shift($keys);
        }

        $data[$keys[0]] = $value;

        return $this;
    }
1043198
public function dateIs(\DateTime $value)
    {
        $this->add(new Criterium(self::CRITERIUM_DATE_IS, $value));

        return $this;
    }