Elgg  Version 5.1
Public Member Functions | List of all members
Elgg\EntityIcon Interface Reference

Entities that support icons should implement this interface. More...

Inheritance diagram for Elgg\EntityIcon:
ElggEntity ElggGroup ElggObject ElggSite ElggUser ElggAdminNotice ElggComment ElggFile ElggPlugin ElggUpgrade ElggWidget ElggIcon ElggTempFile

Public Member Functions

 saveIconFromUploadedFile (string $input_name, string $type= 'icon', array $coords=[])
 Saves icons using an uploaded file as the source. More...
 
 saveIconFromLocalFile (string $filename, string $type= 'icon', array $coords=[])
 Saves icons using a local file as the source. More...
 
 saveIconFromElggFile (\ElggFile $file, string $type= 'icon', array $coords=[])
 Saves icons using a file located in the data store as the source. More...
 
 getIcon (string $size, string $type= 'icon')
 Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore. More...
 
 deleteIcon (string $type= 'icon')
 Removes all icon files and metadata for the passed type of icon. More...
 
 getIconURL (array $params)
 Returns a URL of the icon. More...
 
 getIconLastChange (string $size, string $type= 'icon')
 Returns the timestamp of when the icon was changed. More...
 
 hasIcon (string $size, string $type= 'icon')
 Returns if the entity has an icon of the passed type. More...
 

Detailed Description

Entities that support icons should implement this interface.

Definition at line 7 of file EntityIcon.php.

Member Function Documentation

Elgg\EntityIcon::deleteIcon ( string  $type = 'icon')

Removes all icon files and metadata for the passed type of icon.

Parameters
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
Returns
bool

Implemented in ElggEntity.

Elgg\EntityIcon::getIcon ( string  $size,
string  $type = 'icon' 
)

Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore.

Parameters
string$sizeSize of the icon
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
Returns

Implemented in ElggEntity.

Elgg\EntityIcon::getIconLastChange ( string  $size,
string  $type = 'icon' 
)

Returns the timestamp of when the icon was changed.

Parameters
string$sizeThe size of the icon
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
Returns
int|null A unix timestamp of when the icon was last changed, or null if not set.

Implemented in ElggEntity.

Elgg\EntityIcon::getIconURL ( array  $params)

Returns a URL of the icon.

Parameters
array$paramsAn array of paramaters including: string 'size' => the size of the icon (default: medium) string 'type' => the icon type (default: icon)
Returns
string
Elgg\EntityIcon::hasIcon ( string  $size,
string  $type = 'icon' 
)

Returns if the entity has an icon of the passed type.

Parameters
string$sizeThe size of the icon
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
Returns
bool

Implemented in ElggEntity.

Elgg\EntityIcon::saveIconFromElggFile ( \ElggFile  $file,
string  $type = 'icon',
array  $coords = [] 
)

Saves icons using a file located in the data store as the source.

Parameters
string$fileAn ElggFile instance
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
array$coordsAn array of cropping coordinates x1, y1, x2, y2
Returns
bool

Implemented in ElggEntity.

Elgg\EntityIcon::saveIconFromLocalFile ( string  $filename,
string  $type = 'icon',
array  $coords = [] 
)

Saves icons using a local file as the source.

Parameters
string$filenameThe full path to the local file
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
array$coordsAn array of cropping coordinates x1, y1, x2, y2
Returns
bool

Implemented in ElggEntity.

Elgg\EntityIcon::saveIconFromUploadedFile ( string  $input_name,
string  $type = 'icon',
array  $coords = [] 
)

Saves icons using an uploaded file as the source.

Parameters
string$input_nameForm input name
string$typeThe name of the icon. e.g., 'icon', 'cover_photo'
array$coordsAn array of cropping coordinates x1, y1, x2, y2
Returns
bool

Implemented in ElggEntity.


The documentation for this interface was generated from the following file: