Elgg  Version master
Functions
annotations.php File Reference

Go to the source code of this file.

Functions

 elgg_get_annotation_from_id (int $id)
 Elgg annotations Functions to manage object annotations. More...
 
 elgg_delete_annotation_by_id (int $id)
 Deletes an annotation using its ID. More...
 
 elgg_get_annotations (array $options=[])
 Fetch annotations or perform a calculation on them. More...
 
 elgg_list_annotations (array $options=[])
 Returns a rendered list of annotations with pagination. More...
 
 elgg_delete_annotations (array $options)
 Deletes annotations based on $options. More...
 
 elgg_annotation_exists (int $entity_guid, string $name, int $owner_guid=0)
 Check to see if a user has already created an annotation on an object. More...
 

Function Documentation

elgg_annotation_exists ( int  $entity_guid,
string  $name,
int  $owner_guid = 0 
)

Check to see if a user has already created an annotation on an object.

Parameters
int$entity_guidEntity guid
string$nameAnnotation name
int$owner_guidDefaults to logged in user.
Returns
bool
Since
1.8.0

Definition at line 99 of file annotations.php.

elgg_delete_annotation_by_id ( int  $id)

Deletes an annotation using its ID.

Parameters
int$idThe annotation ID to delete.
Returns
bool

Definition at line 27 of file annotations.php.

elgg_delete_annotations ( array  $options)

Deletes annotations based on $options.

Warning
Unlike elgg_get_annotations() this will not accept an empty options array! This requires at least one constraint: annotation_owner_guid(s), annotation_name(s), annotation_value(s), or guid(s) must be set.
Parameters
array$optionsAn options array. elgg_get_annotations()
Returns
bool true on success, false on failure
Since
1.8.0

Definition at line 85 of file annotations.php.

elgg_get_annotation_from_id ( int  $id)

Elgg annotations Functions to manage object annotations.

Get a specific annotation by its id. If you want multiple annotation objects, use elgg_get_annotations().

Parameters
int$idThe id of the annotation object being retrieved.
Returns
|null

Definition at line 16 of file annotations.php.

elgg_get_annotations ( array  $options = [])

Fetch annotations or perform a calculation on them.

Accepts all options supported by elgg_get_entities()

The default 'order_by' is 'a_table.time_created, a_table.id',

Parameters
array$optionsOptions
Returns
[]|mixed
See also
elgg_get_entities()
Since
1.8.0

Definition at line 50 of file annotations.php.

elgg_list_annotations ( array  $options = [])

Returns a rendered list of annotations with pagination.

Parameters
array$optionsAnnotation getter and display options. elgg_get_annotations() and elgg_list_entities().
Returns
string The list of entities
Since
1.8.0

Definition at line 63 of file annotations.php.