src/Meta.php
public function setValueAttribute($value)
    {
        $registry = $this->getDataTypeRegistry();

        $this->attributes['type'] = $registry->getTypeForValue($value);
        $this->attributes['value'] = $registry->getHandlerForType($this->type)
            ->serializeValue($value);

        $this->cachedValue = null;
    }
public function setValueAttribute($value)
    {
        $registry = $this->getDataTypeRegistry();

        $this->attributes['type'] = $registry->getTypeForValue($value);
        $this->attributes['value'] = $registry->getHandlerForType($this->type)
            ->serializeValue($value);

        $this->cachedValue = null;
    }
public function setValueAttribute ( $ value ) { $ registry = $ this -> getDataTypeRegistry ( ) ; $ this -> attributes [ 'type' ] = $ registry -> getTypeForValue ( $ value ) ; $ this -> attributes [ 'value' ] = $ registry -> getHandlerForType ( $ this -> type ) -> serializeValue ( $ value ) ; $ this -> cachedValue = null ; }
Mutator for value.

The `type` attribute will be automatically updated to match the datatype of the input.

@param mixed $value
Mutator for value .