protected function validateMultiValue($value, array $attributes)
    {
        if (null === $value) {
            return array();
        }

        if (!is_array($value)) {
            return (array) $value;
        }

        if (!isset($attributes['multiple']) || !$attributes['multiple']) {
            throw new Exception\DomainException(sprintf(
                '%s does not allow specifying multiple selected values when the element does not have a multiple attribute set to a boolean true',
                __CLASS__
            ));
        }

        return $value;
    }
protected function validateMultiValue($value, array $attributes)
    {
        if (null === $value) {
            return array();
        }

        if (!is_array($value)) {
            return (array) $value;
        }

        if (!isset($attributes['multiple']) || !$attributes['multiple']) {
            throw new Exception\DomainException(sprintf(
                '%s does not allow specifying multiple selected values when the element does not have a multiple attribute set to a boolean true',
                __CLASS__
            ));
        }

        return $value;
    }
protected function validateMultiValue ( $ value , array $ attributes ) { if ( null === $ value ) { return array ( ) ; } if ( ! is_array ( $ value ) ) { return ( array ) $ value ; } if ( ! isset ( $ attributes [ 'multiple' ] ) || ! $ attributes [ 'multiple' ] ) { throw new Exception \ DomainException ( sprintf ( '%s does not allow specifying multiple selected values when the element does not have a multiple attribute set to a boolean true' , __CLASS__ ) ) ; } return $ value ; }
Ensure that the value is set appropriately

If the element's value attribute is an array, but there is no multiple
attribute, or that attribute does not evaluate to true, then we have
a domain issue -- you cannot have multiple options selected unless the
multiple attribute is present and enabled.

@param  mixed $value
@param  array $attributes
@return array
@throws Exception\DomainException
Ensure that the value is set appropriately