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

checkValueType() protected static method

This is an operation method for {@see \acceptValue()}. Default implementation expects the value class to reside in the same namespace as its FieldType class and is named "Value". Example implementation: static protected function checkValueType( $value ) { if ( !$inputValue instanceof \eZ\Publish\Core\FieldType\CookieJar\Value ) ) { throw new InvalidArgumentException( "Given value type is not supported." ); } }
protected static checkValueType ( mixed $value )
$value mixed A value returned by {@see \createValueFromInput()}.
    protected static function checkValueType($value)
    {
        $fieldTypeFQN = get_called_class();
        $valueFQN = substr_replace($fieldTypeFQN, 'Value', strrpos($fieldTypeFQN, '\\') + 1);
        if (!$value instanceof $valueFQN) {
            throw new InvalidArgumentType('$value', $valueFQN, $value);
        }
    }