Elgg  Version 2.3
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 Represents ElggComment ElggFile ElggPlugin ElggUpgrade ElggWidget ElggIcon

Public Member Functions

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

Implemented in ElggEntity.

Elgg\EntityIcon::hasIcon (   $size,
  $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,
  $type = 'icon',
array  $coords = array() 
)

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 (   $filename,
  $type = 'icon',
array  $coords = array() 
)

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 (   $input_name,
  $type = 'icon',
array  $coords = array() 
)

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: