PHP Интерфейс Imbo\Storage\StorageInterface

This is an interface for storage adapters in Imbo.
Автор: Christer Edvartsen ([email protected])
Показать файл Открыть проект

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

Метод Описание
delete ( string $user, string $imageIdentifier ) : boolean Delete an image
getImage ( string $user, string $imageIdentifier ) : string Get image content
getLastModified ( string $user, string $imageIdentifier ) : DateTime Get the last modified timestamp
getStatus ( ) : boolean Get the current status of the storage
imageExists ( string $user, string $imageIdentifier ) : DateTime See if the image already exists
store ( string $user, string $imageIdentifier, string $imageData ) : boolean Store an image

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

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

This method will delete the file associated with $imageIdentifier from the storage medium
public delete ( string $user, string $imageIdentifier ) : boolean
$user string The user which the image belongs to
$imageIdentifier string Image identifier
Результат boolean Returns true on success or false on failure

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

Get image content
public getImage ( string $user, string $imageIdentifier ) : string
$user string The user which the image belongs to
$imageIdentifier string Image identifier
Результат string The binary content of the image

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

Get the last modified timestamp
public getLastModified ( string $user, string $imageIdentifier ) : DateTime
$user string The user which the image belongs to
$imageIdentifier string Image identifier
Результат DateTime Returns an instance of DateTime

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

This method is used with the status resource.
public getStatus ( ) : boolean
Результат boolean

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

See if the image already exists
public imageExists ( string $user, string $imageIdentifier ) : DateTime
$user string The user which the image belongs to
$imageIdentifier string Image identifier
Результат DateTime Returns an instance of DateTime

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

This method will receive the binary data of the image and store it somewhere suited for the actual storage adaper. If an error occurs the adapter should throw an Imbo\Exception\StorageException exception. If the image already exists, simply overwrite it.
public store ( string $user, string $imageIdentifier, string $imageData ) : boolean
$user string The user which the image belongs to
$imageIdentifier string The image identifier
$imageData string The image data to store
Результат boolean Returns true on success or false on failure