Mongolid\DataMapper\SchemaMapper::cast PHP Method

cast() protected method

Uses PHP's settype to cast a value to a type.
See also: http://php.net/manual/pt_BR/function.settype.php
protected cast ( mixed $value, string $type ) : mixed
$value mixed Value to be casted.
$type string Type to which the $value should be casted to.
return mixed
    protected function cast($value, string $type)
    {
        settype($value, $type);
        return $value;
    }