PHP Класс Imbo\EventListener\ImageVariations

Автор: Christer Edvartsen ([email protected])
Наследование: implements Imbo\EventListener\ListenerInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $params = [] ) Class constructor
adjustImageTransformations ( Imbo\EventManager\EventInterface $event ) Adjust image transformations
chooseVariation ( Imbo\EventManager\EventInterface $event ) Choose an image variation based on the transformations and the original size of the image
deleteVariations ( Imbo\EventManager\EventInterface $event ) Delete all image variations attached to an image
generateVariations ( Imbo\EventManager\EventInterface $event ) Generate multiple variations based on the configuration
getMaxWidth ( integer $width, integer $height, array $transformations ) : array | null Fetch the maximum width present in the set of transformations
getSubscribedEvents ( )

Приватные методы

Метод Описание
configureDatabase ( array $config ) Configure the database adapter
configureStorage ( array $config ) Configure the storage adapter

Описание методов

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

Class constructor
public __construct ( array $params = [] )
$params array Parameters for the event listener

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

This method will adjust transformation parameters based on the ration between the original image and the image variation used.
public adjustImageTransformations ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

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

Choose an image variation based on the transformations and the original size of the image
public chooseVariation ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

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

If any of the delete operations fail Imbo will trigger an error
public deleteVariations ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

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

If any of the operations fail Imbo will trigger errors
public generateVariations ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface

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

Fetch the maximum width present in the set of transformations
public getMaxWidth ( integer $width, integer $height, array $transformations ) : array | null
$width integer The width of the existing image
$height integer The height of the existing image
$transformations array Transformations from the URL
Результат array | null Returns an array with a single element where the index is the index of the transformation that has the maximum width, and the value of the width

getSubscribedEvents() публичный статический Метод

public static getSubscribedEvents ( )