eZ\Publish\Core\FieldType\FieldType::acceptValue PHP Method

acceptValue() final public method

This method first inspects $inputValue and convert it into a dedicated value object. After that, the value is checked for structural validity. Note that this does not include validation after the rules from validators, but only plausibility checks for the general data format. Note that this method must also cope with the empty value for the field type as e.g. returned by {@link getEmptyValue()}.
final public acceptValue ( mixed $inputValue ) : Value
$inputValue mixed
return Value The potentially converted and structurally plausible value.
    public final function acceptValue($inputValue)
    {
        if ($inputValue === null) {
            return $this->getEmptyValue();
        }
        $value = $this->createValueFromInput($inputValue);
        static::checkValueType($value);
        if ($this->isEmptyValue($value)) {
            return $this->getEmptyValue();
        }
        $this->checkValueStructure($value);
        return $value;
    }