Interface GeneratorInterface
Interface for thumbnails generators.
This interface exposes methods to be implemented in concrete classes that will actually generate thumbnails.
Implementing classes are responsible for:
- generating a thumbnail for a Stream with given options
- returning public URL of a thumbnail for a Stream with given options
- check if a thumbnail for a Stream with given options exist
- delete all thumbnails for a Stream
Methods summary
public
string
|
#
getUrl( BEdita\Core\Model\Entity\Stream $stream, array $options = [] )
Get URL for a generated thumbnail.
Get URL for a generated thumbnail.
This method should return a URL even if the thumbnail doesn't already exist, if possible.
Parameters
- $stream
- Stream entity instance.
- $options
- Thumbnail options.
Returns
string
|
public
boolean
|
#
generate( BEdita\Core\Model\Entity\Stream $stream, array $options = [] )
Generate a thumbnail for a Stream entity using the provided options, and return the URL.
Generate a thumbnail for a Stream entity using the provided options, and return the URL.
This method should always generate a thumbnail, even if it already exists, as it might be used for
hard re-generation.
Parameters
- $stream
- Stream entity instance.
- $options
- Thumbnail options.
Returns
boolean Is the thumbnail ready? Synchronous generators should return true , asynchronous generators should return false .
|
public
boolean
|
#
exists( BEdita\Core\Model\Entity\Stream $stream, array $options = [] )
Check if a thumbnail for a Stream entity using the provided options already exists.
Check if a thumbnail for a Stream entity using the provided options already exists.
Parameters
- $stream
- Stream entity instance.
- $options
- Thumbnail options.
Returns
boolean Is the thumbnail ready?
|
public
|
#
delete( BEdita\Core\Model\Entity\Stream $stream )
Delete all created thumbnails for a stream.
Delete all created thumbnails for a stream.
Parameters
- $stream
- Stream entity instance.
|