class ImageOrientationValidator extends AbstractValidator (View source)

Validator that checks the orientation (square, portrait, landscape) of a given image.

Supported validator options are (array)allowedOrientations with one or two out of 'square', 'landcape' or 'portrait'.

Example::

[at]Flow\Validate("$image", type="\Neos\Media\Validator\ImageOrientationValidator", options={ "allowedOrientations"={"square", "landscape"} })

this would refuse an image that is in portrait orientation, but allow landscape and square ones.

Properties

protected array $supportedOptions

Methods

void
isValid(ImageInterface $image)

The given $value is valid if it is an \Neos\Media\Domain\Model\ImageInterface of the configured orientation (square, portrait and/or landscape) Note: a value of NULL or empty string ('') is considered valid

void
validateOptions()

No description

Details

protected void isValid(ImageInterface $image)

The given $value is valid if it is an \Neos\Media\Domain\Model\ImageInterface of the configured orientation (square, portrait and/or landscape) Note: a value of NULL or empty string ('') is considered valid

Parameters

ImageInterface $image

The image that should be validated

Return Value

void

protected void validateOptions()

No description

Return Value

void

Exceptions

InvalidValidationOptionsException