PHP Class Pimcore\Model\Asset\Image\Thumbnail

Show file Open project: pimcore/pimcore Class Usage Examples

Protected Properties

Property Type Description
$asset Pimcore\Model\Asset\Image
$config Pimcore\Model\Asset\Image\Thumbnail\Config
$deferred boolean
$embedPicturePolyfill boolean
$filesystemPath mixed | string
$height integer
$mimetype string
$pictureElementInUse boolean
$realHeight integer
$realWidth integer
$width integer

Public Methods

Method Description
__construct ( $asset, null $config = null, boolean $deferred = true )
__toString ( ) : string Get the public path to the thumbnail image.
generate ( boolean $deferredAllowed = true )
getAsset ( ) : Image
getChecksum ( string $type = "md5" ) : null | string
getConfig ( ) : Config Get thumbnail image configuration.
getDimensions ( ) : array
getEmbedPicturePolyfill ( ) : boolean
getFileExtension ( ) : string
getFileSystemPath ( boolean $deferredAllowed = false ) : mixed | string
getHTML ( array $options = [], array $removeAttributes = [] ) : string Get generated HTML for displaying the thumbnail image in a HTML document. (XHTML compatible).
getHeight ( ) : integer Get the width of the generated thumbnail image in pixels.
getMedia ( string $name, integer $highRes = 1 ) : Thumbnail
getMimeType ( ) : string Get the height of the generated thumbnail image in pixels.
getPath ( boolean $deferredAllowed = true ) : mixed | string
getRealHeight ( ) : integer Get the real width of the generated thumbnail image in pixels. (when using high resolution option)
getRealWidth ( ) : integer
getWidth ( ) : integer
isPictureElementInUse ( ) : boolean
reset ( )
setEmbedPicturePolyfill ( boolean $embedPicturePolyfill )
setPictureElementInUse ( boolean $flag ) : void Enables, when set to true, dispatchLoopShutdown of Pimcore_Controller_Plugin_Thumbnail

Protected Methods

Method Description
createConfig ( mixed $selector ) : Config Get a thumbnail image configuration.

Method Details

__construct() public method

public __construct ( $asset, null $config = null, boolean $deferred = true )
$asset
$config null
$deferred boolean

__toString() public method

This method is here for backwards compatility. Up to Pimcore 1.4.8 a thumbnail was returned as a path to an image.
public __toString ( ) : string
return string Public path to thumbnail image.

createConfig() protected method

Get a thumbnail image configuration.
protected createConfig ( mixed $selector ) : Config
$selector mixed Name, array or object describing a thumbnail configuration.
return Pimcore\Model\Asset\Image\Thumbnail\Config

generate() public method

public generate ( boolean $deferredAllowed = true )
$deferredAllowed boolean

getAsset() public method

public getAsset ( ) : Image
return Pimcore\Model\Asset\Image The original image from which this thumbnail is generated.

getChecksum() public method

public getChecksum ( string $type = "md5" ) : null | string
$type string
return null | string

getConfig() public method

Get thumbnail image configuration.
public getConfig ( ) : Config
return Pimcore\Model\Asset\Image\Thumbnail\Config

getDimensions() public method

public getDimensions ( ) : array
return array

getEmbedPicturePolyfill() public static method

public static getEmbedPicturePolyfill ( ) : boolean
return boolean

getFileExtension() public method

public getFileExtension ( ) : string
return string

getFileSystemPath() public method

public getFileSystemPath ( boolean $deferredAllowed = false ) : mixed | string
$deferredAllowed boolean
return mixed | string

getHTML() public method

Attributes can be added as a parameter. Attributes containing illigal characters are ignored. Width and Height attribute can be overridden. SRC-attribute not. Values of attributes are escaped.
public getHTML ( array $options = [], array $removeAttributes = [] ) : string
$options array Custom configurations and HTML attributes.
$removeAttributes array Listof key-value pairs of HTML attributes that should be removed
return string IMG-element with at least the attributes src, width, height, alt.

getHeight() public method

Get the width of the generated thumbnail image in pixels.
public getHeight ( ) : integer
return integer Height of the generated thumbnail image.

getMedia() public method

public getMedia ( string $name, integer $highRes = 1 ) : Thumbnail
$name string
$highRes integer
return Thumbnail

getMimeType() public method

Get the height of the generated thumbnail image in pixels.
public getMimeType ( ) : string
return string HTTP Mime Type of the generated thumbnail image.

getPath() public method

public getPath ( boolean $deferredAllowed = true ) : mixed | string
$deferredAllowed boolean
return mixed | string

getRealHeight() public method

Get the real width of the generated thumbnail image in pixels. (when using high resolution option)
public getRealHeight ( ) : integer
return integer Height of the generated thumbnail image.

getRealWidth() public method

public getRealWidth ( ) : integer
return integer real Width of the generated thumbnail image. (when using high resolution option)

getWidth() public method

public getWidth ( ) : integer
return integer Width of the generated thumbnail image.

isPictureElementInUse() public static method

public static isPictureElementInUse ( ) : boolean
return boolean

reset() public method

public reset ( )

setEmbedPicturePolyfill() public static method

public static setEmbedPicturePolyfill ( boolean $embedPicturePolyfill )
$embedPicturePolyfill boolean

setPictureElementInUse() public static method

Enables, when set to true, dispatchLoopShutdown of Pimcore_Controller_Plugin_Thumbnail
public static setPictureElementInUse ( boolean $flag ) : void
$flag boolean
return void

Property Details

$asset protected property

protected Image,Pimcore\Model\Asset $asset
return Pimcore\Model\Asset\Image

$config protected property

protected Config,Pimcore\Model\Asset\Image\Thumbnail $config
return Pimcore\Model\Asset\Image\Thumbnail\Config

$deferred protected property

protected bool $deferred
return boolean

$embedPicturePolyfill protected static property

protected static bool $embedPicturePolyfill
return boolean

$filesystemPath protected property

protected mixed|string $filesystemPath
return mixed | string

$height protected property

protected int $height
return integer

$mimetype protected property

protected string $mimetype
return string

$pictureElementInUse protected static property

protected static bool $pictureElementInUse
return boolean

$realHeight protected property

protected int $realHeight
return integer

$realWidth protected property

protected int $realWidth
return integer

$width protected property

protected int $width
return integer