Elgg
Version 2.3
|
WARNING: API IN FLUX. More...
Public Member Functions | |
__construct (Config $config, PluginHooksService $hooks, Request $request, Logger $logger, EntityTable $entities) | |
Constructor. More... | |
saveIconFromUploadedFile (ElggEntity $entity, $input_name, $type= 'icon', array $coords=array()) | |
Saves icons using an uploaded file as the source. More... | |
saveIconFromLocalFile (ElggEntity $entity, $filename, $type= 'icon', array $coords=array()) | |
Saves icons using a local file as the source. More... | |
saveIconFromElggFile (ElggEntity $entity, ElggFile $file, $type= 'icon', array $coords=array()) | |
Saves icons using a file located in the data store as the source. More... | |
saveIcon (ElggEntity $entity, ElggFile $file, $type= 'icon', array $coords=array()) | |
Saves icons using a created temporary file. More... | |
getIcon (ElggEntity $entity, $size, $type= 'icon') | |
Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore. More... | |
deleteIcon (ElggEntity $entity, $type= 'icon') | |
Removes all icon files and metadata for the passed type of icon. More... | |
getIconURL (ElggEntity $entity, $params=array()) | |
Get the URL for this entity's icon. More... | |
getIconLastChange (ElggEntity $entity, $size, $type= 'icon') | |
Returns the timestamp of when the icon was changed. More... | |
hasIcon (\ElggEntity $entity, $size, $type= 'icon') | |
Returns if the entity has an icon of the passed type. More... | |
getSizes ($entity_type=null, $entity_subtype=null, $type= 'icon') | |
Returns a configuration array of icon sizes. More... | |
handleServeIconRequest ($allow_removing_headers=true) | |
Handle request to /serve-icon handler. More... | |
WARNING: API IN FLUX.
DO NOT USE DIRECTLY.
Use the elgg_* versions instead.
private
Definition at line 25 of file EntityIconService.php.
Elgg\EntityIconService::__construct | ( | Config | $config, |
PluginHooksService | $hooks, | ||
Request | $request, | ||
Logger | $logger, | ||
EntityTable | $entities | ||
) |
Constructor.
Config | $config | Config |
PluginHooksService | $hooks | Hook registration service |
Request | $request | Http request |
Logger | $logger | Logger |
EntityTable | $entities | Entity table |
Definition at line 62 of file EntityIconService.php.
Elgg\EntityIconService::deleteIcon | ( | ElggEntity | $entity, |
$type = 'icon' |
|||
) |
Removes all icon files and metadata for the passed type of icon.
ElggEntity | $entity | Entity that owns icons |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Definition at line 335 of file EntityIconService.php.
Elgg\EntityIconService::getIcon | ( | ElggEntity | $entity, |
$size, | |||
$type = 'icon' |
|||
) |
Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore.
ElggEntity | $entity | Entity that owns the icon |
string | $size | Size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
InvalidParameterException |
Definition at line 304 of file EntityIconService.php.
Elgg\EntityIconService::getIconLastChange | ( | ElggEntity | $entity, |
$size, | |||
$type = 'icon' |
|||
) |
Returns the timestamp of when the icon was changed.
ElggEntity | $entity | Entity that owns the icon |
string | $size | The size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Definition at line 406 of file EntityIconService.php.
Elgg\EntityIconService::getIconURL | ( | ElggEntity | $entity, |
$params = array() |
|||
) |
Get the URL for this entity's icon.
Plugins can register for the 'entity:icon:url', <type> plugin hook to customize the icon for an entity.
ElggEntity | $entity | Entity that owns the icon |
mixed | $params | A string defining the size of the icon (e.g. tiny, small, medium, large) or an array of parameters including 'size' |
Definition at line 369 of file EntityIconService.php.
Elgg\EntityIconService::getSizes | ( | $entity_type = null , |
|
$entity_subtype = null , |
|||
$type = 'icon' |
|||
) |
Returns a configuration array of icon sizes.
string | $entity_type | Entity type |
string | $entity_subtype | Entity subtype |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
InvalidParameterException |
Definition at line 434 of file EntityIconService.php.
Elgg\EntityIconService::handleServeIconRequest | ( | $allow_removing_headers = true | ) |
Handle request to /serve-icon handler.
bool | $allow_removing_headers | Alter PHP's global headers to allow caching |
Definition at line 471 of file EntityIconService.php.
Elgg\EntityIconService::hasIcon | ( | \ElggEntity | $entity, |
$size, | |||
$type = 'icon' |
|||
) |
Returns if the entity has an icon of the passed type.
ElggEntity | $entity | Entity that owns the icon |
string | $size | The size of the icon |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
Definition at line 421 of file EntityIconService.php.
Elgg\EntityIconService::saveIcon | ( | ElggEntity | $entity, |
ElggFile | $file, | ||
$type = 'icon' , |
|||
array | $coords = array() |
||
) |
Saves icons using a created temporary file.
ElggEntity | $entity | Temporary ElggFile instance |
ElggFile | $file | Temporary ElggFile instance |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
Definition at line 185 of file EntityIconService.php.
Elgg\EntityIconService::saveIconFromElggFile | ( | ElggEntity | $entity, |
ElggFile | $file, | ||
$type = 'icon' , |
|||
array | $coords = array() |
||
) |
Saves icons using a file located in the data store as the source.
ElggEntity | $entity | Entity to own the icons |
ElggFile | $file | An ElggFile instance |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
InvalidParameterException |
Definition at line 153 of file EntityIconService.php.
Elgg\EntityIconService::saveIconFromLocalFile | ( | ElggEntity | $entity, |
$filename, | |||
$type = 'icon' , |
|||
array | $coords = array() |
||
) |
Saves icons using a local file as the source.
ElggEntity | $entity | Entity to own the icons |
string | $filename | The full path to the local file |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
InvalidParameterException |
Definition at line 120 of file EntityIconService.php.
Elgg\EntityIconService::saveIconFromUploadedFile | ( | ElggEntity | $entity, |
$input_name, | |||
$type = 'icon' , |
|||
array | $coords = array() |
||
) |
Saves icons using an uploaded file as the source.
ElggEntity | $entity | Entity to own the icons |
string | $input_name | Form input name |
string | $type | The name of the icon. e.g., 'icon', 'cover_photo' |
array | $coords | An array of cropping coordinates x1, y1, x2, y2 |
Definition at line 79 of file EntityIconService.php.