eZ\Publish\Core\FieldType\RelationList\Type::checkValueStructure PHP Method

checkValueStructure() protected method

Throws an exception if value structure is not of expected format.
protected checkValueStructure ( Value $value )
$value eZ\Publish\Core\FieldType\Value
    protected function checkValueStructure(BaseValue $value)
    {
        if (!is_array($value->destinationContentIds)) {
            throw new InvalidArgumentType('$value->destinationContentIds', 'array', $value->destinationContentIds);
        }
        foreach ($value->destinationContentIds as $key => $destinationContentId) {
            if (!is_integer($destinationContentId) && !is_string($destinationContentId)) {
                throw new InvalidArgumentType("\$value->destinationContentIds[{$key}]", 'string|int', $destinationContentId);
            }
        }
    }