Neos\Media\Domain\Model\ImageInterface::getOrientation PHP Метод

getOrientation() публичный Метод

Orientation of this image, i.e. portrait, landscape or square
public getOrientation ( ) : string
Результат string One of this interface's ORIENTATION_* constants.
    public function getOrientation();

Usage Example

 /**
  * 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
  *
  * @param ImageInterface $image The image that should be validated
  * @return void
  * @api
  */
 protected function isValid($image)
 {
     $this->validateOptions();
     if (!$image instanceof ImageInterface) {
         $this->addError('The given value was not an Image instance.', 1328028604);
         return;
     }
     if (!in_array($image->getOrientation(), $this->options['allowedOrientations'])) {
         if (count($this->options['allowedOrientations']) === 1) {
             reset($this->options['allowedOrientations']);
             $allowedOrientation = current($this->options['allowedOrientations']);
             $this->addError('The image orientation must be "%s".', 1328029406, array($allowedOrientation));
         } else {
             $this->addError('The image orientation "%s" is not allowed.', 1328029362, array($image->getOrientation()));
         }
     }
 }