PHP Интерфейс Elgg\EntityIcon

Показать файл Открыть проект

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

Метод Описание
deleteIcon ( string $type = 'icon' ) : boolean Removes all icon files and metadata for the passed type of icon.
getIcon ( string $size, string $type = 'icon' ) : ElggIcon Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore
getIconLastChange ( string $size, string $type = 'icon' ) : integer | null Returns the timestamp of when the icon was changed.
getIconURL ( array $params ) : string Returns a URL of the icon.
hasIcon ( string $size, string $type = 'icon' ) : boolean Returns if the entity has an icon of the passed type.
saveIconFromElggFile ( ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean Saves icons using a file located in the data store as the source.
saveIconFromLocalFile ( string $filename, string $type = 'icon', array $coords = [] ) : boolean Saves icons using a local file as the source.
saveIconFromUploadedFile ( string $input_name, string $type = 'icon', array $coords = [] ) : boolean Saves icons using an uploaded file as the source.

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

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

Removes all icon files and metadata for the passed type of icon.
public deleteIcon ( string $type = 'icon' ) : boolean
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат boolean

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

Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore
public getIcon ( string $size, string $type = 'icon' ) : ElggIcon
$size string Size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат ElggIcon

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

Returns the timestamp of when the icon was changed.
public getIconLastChange ( string $size, string $type = 'icon' ) : integer | null
$size string The size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат integer | null A unix timestamp of when the icon was last changed, or null if not set.

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

Returns a URL of the icon.
public getIconURL ( array $params ) : string
$params array An array of paramaters including: string 'size' => the size of the icon (default: medium) string 'type' => the icon type (default: icon)
Результат string

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

Returns if the entity has an icon of the passed type.
public hasIcon ( string $size, string $type = 'icon' ) : boolean
$size string The size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат boolean

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

Saves icons using a file located in the data store as the source.
public saveIconFromElggFile ( ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean
$file ElggFile An ElggFile instance
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean

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

Saves icons using a local file as the source.
public saveIconFromLocalFile ( string $filename, string $type = 'icon', array $coords = [] ) : boolean
$filename string The full path to the local file
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean

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

Saves icons using an uploaded file as the source.
public saveIconFromUploadedFile ( string $input_name, string $type = 'icon', array $coords = [] ) : boolean
$input_name string Form input name
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean