Set an value
@param int - index of the field
@param Mixed $value
@return mixed
162172
protected function setValue($index, $value)
    {
        if (gettype($value) === 'object') {
            $this->values[$index] = $value;
        } else {
            $class_name = $this->fields[$index];
            $real_class_name = __NAMESPACE__ . "\\" . $class_name;
            $this->values[$index] = new $real_class_name();
            $this->values[$index]->value = $value;
        }
        return $this;
    }
81383
private function assignValue($value)
    {
        if ($this->isMutable()) {
            $result = $this->internalSetValue($value);
        } else {
            $result = new BigNumber($value, $this->getScale(), false);
        }

        return $result;
    }
875316
final public function set($value)
    {
        $isValid = false;

        if ($value === null) {
            $this->clear();
            $isValid = true;
        } elseif (is_object($value)) {
            $isValid = $this->fromObject($value);
        } elseif (is_bool($value)) {
            $isValid = $this->fromBool($value);
        } elseif (is_int($value)) {
            $isValid = $this->fromInt($value);
        } elseif (is_double($value)) {
            $isValid = $this->fromDouble($value);
        } elseif (is_string($value)) {
            $isValid = $this->fromString($value);
        } elseif (is_array($value)) {
            $isValid = $this->fromArray($value);
        } elseif (is_resource($value)) {
            $isValid = $this->fromResource($value);
        }

        if (!$isValid) {
            throw new \UnexpectedValueException(sprintf(
                'The value of type "%s" could not be converted to "%s".', gettype($value), get_called_class()
            ));
        }
        return $this;
    }
168006
public function setMax(int $value)
    {
        $this->max = $value;

        $this->addValidationRule('max:' . $value);

        return $this;
    }
1050275
public function setId(int $value) : User
    {

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

        return $this;
    }
134887
public function setValue( $value )
    {
        if ( $value instanceof Traversable )
        {
            $value = ArrayUtils::iteratorToArray( $value );
        }

        return parent::setValue( (array) $value );
    }
548898
public function int($value)
    {
        if ($this->notBeEmpty($value)) {
            if (is_int($value)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
799810
public function setIsHidden(int $value) : User
    {

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

        return $this;
    }
815073
public function set($value = null) 
    {
        if (is_null($value)) {
            $value = array();
        }
        
        if (!is_array($value)) {
            $value = func_get_args();
        }
        
        $this->__construct($value);
        
        return $this;
    }
1112795
public function setFieldValue(string $field, int $value) : bool
        {
                return $this->_redis->zadd($this->_key, $value, $field) > 0 ? true : false;
        }
771937
public function setValue($value)
    {
        $this->value = $value;
        if ($value instanceof ValueAwareInterface) {
            $this->value = $value->getFormValue();
        }
        return $this;
    }
261205
public function set($field, $value = null)
    {
        if (! is_array($field)) {
            $field = [$field => $value];
        }

        foreach ($field as $f => $v) {
            $this->update('$set', $f, $v);
        }

        return $this;
    }
1293074
public function setValue($value)
    {
        switch ($this->type) {
            case Parameter::TYPE_INTEGER:
                $this->value = (int) $value;
                break;
            case Parameter::TYPE_STRING:
            case Parameter::TYPE_ANY:
            default:
                $this->value = (string) $value;
        }

        return $this;
    }
1059119
public function setValue($value){

        $returnValue = false;

        if(!is_null($value)){
            try{
                $value = new static::$type($value);
                if(!is_null($value)){
                    $this->value = $value;
                    $returnValue = true;
                }
            }catch(DatatypeException $de){
                $type = '('.gettype($value).')';
                if($type == 'object'){
                    $type .= '('.get_class($value).')';
                }
                throw new AttributeException('Cannot assign the value to attribute: '.static::$name.' -> '.$type.' '.$value);
            }
        }

        return $returnValue;
    }
1151981
public function setValue($value)
    {
        foreach ((array)$this as $element) {
            if ($value == $element->getElement()->getValue()) {
                $element->getElement()->check();
            } else {
                $element->getElement()->check(false);
            }
        }
    }
837162
public function setValue($value)
    {
        if (\is_array($value)) {
            $this->setValueArray($value);
            $value = implode(', ', $value);
        }

        $this->setAttribute('value', $value);

        return $this;
    }
1080327
public static function integer($value){

		$value = static::_nullValue($value);

		if($value !== null){

			$value = (int) $value;
		}

		return $value;
	}