PHP Class Imbo\Model\Image

Author: Christer Edvartsen ([email protected])
Inheritance: implements Imbo\Model\ModelInterface
Mostrar archivo Open project: imbo/imbo Class Usage Examples

Public Properties

Property Type Description
$mimeTypeMapping array Mapping for some mime types
$mimeTypes array Supported mime types and the correct file extensions

Public Methods

Method Description
getAddedDate ( ) : DateTime Get the added date
getBlob ( ) : string Get the blob
getChecksum ( ) : string Get the checksum of the current image data
getData ( )
getExtension ( ) : string Get the extension
getFileExtension ( string $mime ) : boolean | string Get the file extension mapped to a mime type
getFilesize ( ) : integer Get the size of the image data in bytes
getHeight ( ) : integer Get the height
getImageIdentifier ( ) : string Get the image identifier
getMetadata ( ) : array Get the metadata
getMimeType ( ) : string Get the mime type
getOriginalChecksum ( ) : string Get the original checksum of the current image data
getUpdatedDate ( ) : DateTime Get the updated date
getUser ( ) : string Get the user
getWidth ( ) : integer Get the width
hasBeenTransformed ( boolean | null $flag = null ) : boolean | self Set or get the hasBeenTransformed flag
setAddedDate ( DateTime $added ) : Image Set the added date
setBlob ( string $blob ) : Image Set the blob and update filesize and checksum properties
setChecksum ( string $checksum ) : Image Set the checksum
setExtension ( string $extension ) : Image Set the extension
setFilesize ( integer $size ) : Image Set the size of the image in bytes
setHeight ( integer $height ) : Image Set the height
setImageIdentifier ( string $imageIdentifier ) : Image Set the image identifier
setMetadata ( array $metadata ) : Image Set the metadata
setMimeType ( string $mimeType ) : Image Set the mime type
setOriginalChecksum ( $checksum ) : Image Set the original checksum
setUpdatedDate ( DateTime $updated ) : Image Set the updated date
setUser ( string $user ) : Image Set the user
setWidth ( integer $width ) : Image Set the width
supportedMimeType ( string $mime ) : boolean Check if a mime type is supported by Imbo

Method Details

getAddedDate() public method

Get the added date
public getAddedDate ( ) : DateTime
return DateTime

getBlob() public method

Get the blob
public getBlob ( ) : string
return string

getChecksum() public method

Get the checksum of the current image data
public getChecksum ( ) : string
return string

getData() public method

public getData ( )

getExtension() public method

Get the extension
public getExtension ( ) : string
return string

getFileExtension() public static method

Get the file extension mapped to a mime type
public static getFileExtension ( string $mime ) : boolean | string
$mime string The mime type. For instance "image/png"
return boolean | string The extension (without the leading dot) on success or boolean false if the mime type is not supported.

getFilesize() public method

Get the size of the image data in bytes
public getFilesize ( ) : integer
return integer

getHeight() public method

Get the height
public getHeight ( ) : integer
return integer

getImageIdentifier() public method

Get the image identifier
public getImageIdentifier ( ) : string
return string

getMetadata() public method

Get the metadata
public getMetadata ( ) : array
return array

getMimeType() public method

Get the mime type
public getMimeType ( ) : string
return string

getOriginalChecksum() public method

Get the original checksum of the current image data
public getOriginalChecksum ( ) : string
return string

getUpdatedDate() public method

Get the updated date
public getUpdatedDate ( ) : DateTime
return DateTime

getUser() public method

Get the user
public getUser ( ) : string
return string

getWidth() public method

Get the width
public getWidth ( ) : integer
return integer

hasBeenTransformed() public method

Set or get the hasBeenTransformed flag
public hasBeenTransformed ( boolean | null $flag = null ) : boolean | self
$flag boolean | null Skip the argument to get the current value
return boolean | self

setAddedDate() public method

Set the added date
public setAddedDate ( DateTime $added ) : Image
$added DateTime When the image was added
return Image

setBlob() public method

Set the blob and update filesize and checksum properties
public setBlob ( string $blob ) : Image
$blob string The binary data to set
return Image

setChecksum() public method

Set the checksum
public setChecksum ( string $checksum ) : Image
$checksum string The checksum to set
return Image

setExtension() public method

Set the extension
public setExtension ( string $extension ) : Image
$extension string The file extension
return Image

setFilesize() public method

Set the size of the image in bytes
public setFilesize ( integer $size ) : Image
$size integer The size of the image
return Image

setHeight() public method

Set the height
public setHeight ( integer $height ) : Image
$height integer Height in pixels
return Image

setImageIdentifier() public method

Set the image identifier
public setImageIdentifier ( string $imageIdentifier ) : Image
$imageIdentifier string The image identifier
return Image

setMetadata() public method

Set the metadata
public setMetadata ( array $metadata ) : Image
$metadata array An array with metadata
return Image

setMimeType() public method

Set the mime type
public setMimeType ( string $mimeType ) : Image
$mimeType string The mime type, for instance "image/png"
return Image

setOriginalChecksum() public method

Set the original checksum
public setOriginalChecksum ( $checksum ) : Image
return Image

setUpdatedDate() public method

Set the updated date
public setUpdatedDate ( DateTime $updated ) : Image
$updated DateTime When the image was updated
return Image

setUser() public method

Set the user
public setUser ( string $user ) : Image
$user string The user
return Image

setWidth() public method

Set the width
public setWidth ( integer $width ) : Image
$width integer Width in pixels
return Image

supportedMimeType() public static method

Check if a mime type is supported by Imbo
public static supportedMimeType ( string $mime ) : boolean
$mime string The mime type to check. For instance "image/png"
return boolean

Property Details

$mimeTypeMapping public_oe static_oe property

Mapping for some mime types
public static array $mimeTypeMapping
return array

$mimeTypes public_oe static_oe property

Supported mime types and the correct file extensions
public static array $mimeTypes
return array