Pheasant\Types\StringType::marshal PHP Method

marshal() public method

* (non-phpdoc)
See also: Pheasant\Type::marshal
public marshal ( $value )
    public function marshal($value)
    {
        if ($this->options()->allowed && !in_array($value, $this->options()->allowed)) {
            throw new \InvalidArgumentException(sprintf('Allowed values for this field are %s.', implode(', ', $this->options()->allowed)));
        }
        return new TypedValue((string) $value);
    }