Метод | Описание | |
---|---|---|
__construct ( |
Constructor | |
deleteIcon ( ElggEntity $entity, string $type = 'icon' ) : boolean | Removes all icon files and metadata for the passed type of icon. | |
getFallbackIconUrl ( ElggEntity $entity, array $params = [] ) : string | Returns default/fallback icon | |
getIcon ( ElggEntity $entity, string $size, string $type = 'icon' ) : ElggIcon | Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore | |
getIconLastChange ( ElggEntity $entity, string $size, string $type = 'icon' ) : integer | null | Returns the timestamp of when the icon was changed. | |
getIconURL ( ElggEntity $entity, mixed $params = [] ) : string | void | Get the URL for this entity's icon | |
getSizes ( string $entity_type = null, string $entity_subtype = null, string $type = 'icon' ) : array | Returns a configuration array of icon sizes | |
handleServeIconRequest ( boolean $allow_removing_headers = true ) : |
Handle request to /serve-icon handler | |
hasIcon ( ElggEntity $entity, string $size, string $type = 'icon' ) : boolean | Returns if the entity has an icon of the passed type. | |
saveIcon ( ElggEntity $entity, ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using a created temporary file | |
saveIconFromElggFile ( ElggEntity $entity, ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using a file located in the data store as the source. | |
saveIconFromLocalFile ( ElggEntity $entity, string $filename, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using a local file as the source. | |
saveIconFromUploadedFile ( ElggEntity $entity, string $input_name, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using an uploaded file as the source. |
public __construct ( |
||
$config | Config | |
$hooks | Hook registration service | |
$request | Http request | |
$logger | Logger | |
$entities | Entity table |
public deleteIcon ( ElggEntity $entity, string $type = 'icon' ) : boolean | ||
$entity | ElggEntity | Entity that owns icons |
$type | string | The name of the icon. e.g., 'icon', 'cover_photo' |
Результат | boolean |
public getFallbackIconUrl ( ElggEntity $entity, array $params = [] ) : string | ||
$entity | ElggEntity | Entity |
$params | array | Icon params |
Результат | string |
public getIconLastChange ( ElggEntity $entity, string $size, string $type = 'icon' ) : integer | null | ||
$entity | ElggEntity | Entity that owns the icon |
$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. |
public handleServeIconRequest ( boolean $allow_removing_headers = true ) : |
||
$allow_removing_headers | boolean | Alter PHP's global headers to allow caching |
Результат |
public saveIcon ( ElggEntity $entity, ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean | ||
$entity | ElggEntity | Temporary ElggFile instance |
$file | ElggFile | Temporary 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 |
public saveIconFromElggFile ( ElggEntity $entity, ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean | ||
$entity | ElggEntity | Entity to own the icons |
$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 |
public saveIconFromLocalFile ( ElggEntity $entity, string $filename, string $type = 'icon', array $coords = [] ) : boolean | ||
$entity | ElggEntity | Entity to own the icons |
$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 |
public saveIconFromUploadedFile ( ElggEntity $entity, string $input_name, string $type = 'icon', array $coords = [] ) : boolean | ||
$entity | ElggEntity | Entity to own the icons |
$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 |