Set the value of Type / type
@param $value int
@return Log
966568
public function setType(?int $value) : Log
    {

        if ($this->data['type'] !== $value) {
            $this->data['type'] = $value;
            $this->setModified('type');
        }

        return $this;
    }
32136
protected function checkType($value)
    {
        if ($value === null) {
            return $value;
        }

        Type::force($value, 'numeric', true);
        return $value === null ? $value : (float)$value;
    }
894822
private function convertType($value)
    {
        $type = gettype($value);

        if ($this->type === $type || !is_scalar($value)) {
            return $value;
        }

        switch ($this->type) {
            case self::TYPE_BOOL:
                return $this->convertBool($value);
            case self::TYPE_INT:
                return $this->convertInt($value);
            case self::TYPE_FLOAT:
                return $this->convertFloat($value);
            default:
                return $this->convertString($value);
        }
    }
74893
public function setValue($value)
    {
        if (is_array($value)) {
            foreach ($value as $childKey => $childValue) {
                $this->children[$childKey] = new static($childValue);
            }
            $this->value = null;
        } else {
            $this->value = $value;
            $this->children = array();
        }
        return $this;
    }
738121
public function setValue(?string $value) : Setting
    {

        if ($this->data['value'] !== $value) {
            $this->data['value'] = $value;
            $this->setModified('value');
        }

        return $this;
    }
1105298
public function setSpecialType(&$value, $type) {

        $type = strtolower($type);

        if ( empty($value) || !in_array($type, self::$supported_special_types) ) {
            throw new InvalidArgumentException("Invalid value type");
        }

        $this->special_types[$value] = $type;

        return $this;

    }
577457
protected function detectType($value): int
    {
        switch (gettype($value)) {
            case 'boolean':
                return \PDO::PARAM_BOOL;
            case 'integer':
                return \PDO::PARAM_INT;
            case 'NULL':
                return \PDO::PARAM_NULL;
            default:
                return \PDO::PARAM_STR;
        }
    }
244732
public function type($field, $value)
    {
        $this->resolver->resolveForTyping($field)->clear()->sendKeys($value);

        return $this;
    }
777871
public function setValue($value)
    {
        $hasType = isset($this->_type) && is_string($this->_type);
        $isMultiple = $hasType && strpos($this->_type, '[]') !== false;

        if ($hasType) {
            $value = $this->_castToExpression($value, $this->_type);
        }

        if ($isMultiple) {
            list($value, $this->_valueExpressions) = $this->_collectExpressions($value);
        }

        $this->_isMultiple = $isMultiple;
        $this->_value = $value;
    }
945563
public function typeCast($value)
    {
        if ($value === null) {
            return $value;
        }
        
        switch ($this->type) {
            case 'string':
            case 'text':
            case 'binary':
            default:
                return $value;
            case 'integer':
                return $this->valueToInteger($value);
            case 'float':
                return (float)$value;
            case 'datetime':
            case 'timestamp':
                return $this->stringToTime($value);
            case 'time':
                return $this->stringToDummyTime($value);
            case 'date':
                return $this->valueToDate($value);
            case 'boolean':
                return $this->valueToBoolean($value);
            default:
                return $value;
        }
    }
1044747
public function setCreateOn($value)
    {
        if (!is_int($value)) {
            throw new JobException('Job setExpiredOn can sets only integer type!');
        }

        return $this->setData(self::P_CREATE_ON, $value);
    }
1017575
public function set($type = null, $key = null, $value = null)
    {
        if (isset($type)) {
            $this->request[$type]["$key"] = $value;
        } else {
            $this->request = array(
                'get' => $_GET,
                'post' => $_POST,
                'files' => $_FILES,
                'cookie' => $_COOKIE
            );
        }

        return $this;
    }
1279727
public function setAccountType($value)
    {
        $allowedAccountTypes = self::allowedAccountTypes();

        if (!in_array($value, $allowedAccountTypes, true)) {
            throw new DomainException(sprintf(self::MSG_UNEXPECTED_ACCOUNT_TYPE, implode(', ', $allowedAccountTypes)));
        }

        return $this->setAttribute('accountType', $value);
    }
1057593
public function setType($value): self
    {
        if (!in_array($value, self::types(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_TYPE, implode(', ', self::types())));
        }

        return $this->setAttribute('type', $value);
    }
848862
public function setValue($value): FieldTypeInterface
    {
        parent::setValue($value);

        if ($this->getValue()) {
            // The value is only set on the field when it fails
            // or when the option "flush" is set to "false".
            // If true, let's automatically add the "checked" attribute.
            $this->options['attributes']['checked'] = 'checked';
        }

        return $this;
    }
708470
public function type($value)
    {
        if ($value instanceof SuperTableBlockType) {
            $this->typeId = $value->id;
        } else if ($value !== null) {
            $this->typeId = (new Query())
                ->select(['id'])
                ->from(['{{%supertableblocktypes}}'])
                ->where(Db::parseParam('id', $value))
                ->column();
        } else {
            $this->typeId = null;
        }

        return $this;
    }
733246
protected function setValue($value)
    {
        if (!is_float($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a float", static::prototype());
        }

        $this->value = $value;
    }