Elgg
Version 1.9
|
Go to the source code of this file.
Namespaces | |
Elgg | |
Save menu items. | |
Functions | |
row_to_elggannotation ($row) | |
Convert a database row to a new ElggAnnotation. More... | |
elgg_get_annotation_from_id ($id) | |
Get a specific annotation by its id. More... | |
elgg_delete_annotation_by_id ($id) | |
Deletes an annotation using its ID. More... | |
create_annotation ($entity_guid, $name, $value, $value_type= '', $owner_guid=0, $access_id=ACCESS_PRIVATE) | |
Create a new annotation. More... | |
update_annotation ($annotation_id, $name, $value, $value_type, $owner_guid, $access_id) | |
Update an annotation. More... | |
elgg_get_annotations (array $options=array()) | |
Returns annotations. More... | |
elgg_list_annotations ($options) | |
Returns a rendered list of annotations with pagination. More... | |
elgg_delete_annotations (array $options) | |
Deletes annotations based on $options. More... | |
elgg_disable_annotations (array $options) | |
Disables annotations based on $options. More... | |
elgg_enable_annotations (array $options) | |
Enables annotations based on $options. More... | |
elgg_get_entities_from_annotations (array $options=array()) | |
Returns entities based upon annotations. More... | |
elgg_list_entities_from_annotations ($options=array()) | |
Returns a viewable list of entities from annotations. More... | |
elgg_get_entities_from_annotation_calculation ($options) | |
Get entities ordered by a mathematical calculation on annotation values. More... | |
elgg_list_entities_from_annotation_calculation ($options) | |
List entities from an annotation calculation. More... | |
elgg_annotation_exists ($entity_guid, $annotation_type, $owner_guid=null) | |
Check to see if a user has already created an annotation on an object. More... | |
_elgg_set_comment_url ($hook, $type, $url, $params) | |
Set the URL for a comment when called from a plugin hook. More... | |
_elgg_annotations_test ($hook, $type, $tests) | |
Register annotation unit tests. More... | |
_elgg_annotations_init () | |
Initialize the annotation library private. More... | |
_elgg_annotations_init | ( | ) |
Initialize the annotation library private.
Definition at line 548 of file annotations.php.
_elgg_annotations_test | ( | $hook, | |
$type, | |||
$tests | |||
) |
Register annotation unit tests.
string | $hook | |
string | $type | |
array | $tests |
Definition at line 537 of file annotations.php.
_elgg_set_comment_url | ( | $hook, | |
$type, | |||
$url, | |||
$params | |||
) |
Set the URL for a comment when called from a plugin hook.
string | $hook | Hook name |
string | $type | Hook type |
string | $url | URL string |
array | $params | Parameters of the hook |
Definition at line 517 of file annotations.php.
create_annotation | ( | $entity_guid, | |
$name, | |||
$value, | |||
$value_type = '' , |
|||
$owner_guid = 0 , |
|||
$access_id = ACCESS_PRIVATE |
|||
) |
Create a new annotation.
int | $entity_guid | GUID of entity to be annotated |
string | $name | Name of annotation |
string | $value | Value of annotation |
string | $value_type | Type of value (default is auto detection) |
int | $owner_guid | Owner of annotation (default is logged in user) |
int | $access_id | Access level of annotation |
Definition at line 66 of file annotations.php.
elgg_annotation_exists | ( | $entity_guid, | |
$annotation_type, | |||
$owner_guid = null |
|||
) |
Check to see if a user has already created an annotation on an object.
int | $entity_guid | Entity guid |
string | $annotation_type | Type of annotation |
int | $owner_guid | Defaults to logged in user. |
Definition at line 484 of file annotations.php.
elgg_delete_annotation_by_id | ( | $id | ) |
Deletes an annotation using its ID.
int | $id | The annotation ID to delete. |
Definition at line 46 of file annotations.php.
elgg_delete_annotations | ( | array | $options | ) |
Deletes annotations based on $options.
array | $options | An options array. elgg_get_annotations() |
Definition at line 255 of file annotations.php.
elgg_disable_annotations | ( | array | $options | ) |
Disables annotations based on $options.
array | $options | An options array. elgg_get_annotations() |
Definition at line 273 of file annotations.php.
elgg_enable_annotations | ( | array | $options | ) |
Enables annotations based on $options.
array | $options | An options array. elgg_get_annotations() |
Definition at line 298 of file annotations.php.
elgg_get_annotation_from_id | ( | $id | ) |
Get a specific annotation by its id.
If you want multiple annotation objects, use elgg_get_annotations().
int | $id | The id of the annotation object being retrieved. |
Definition at line 36 of file annotations.php.
elgg_get_annotations | ( | array | $options = array() | ) |
Returns annotations.
Accepts all elgg_get_entities() options for entity restraints.
array | $options | Array in format: |
annotation_names => null|ARR Annotation names annotation_values => null|ARR Annotation values annotation_ids => null|ARR annotation ids annotation_case_sensitive => BOOL Overall Case sensitive annotation_owner_guids => null|ARR guids for annotation owners annotation_created_time_lower => INT Lower limit for created time. annotation_created_time_upper => INT Upper limit for created time. annotation_calculation => STR Perform the MySQL function on the annotation values returned. Do not confuse this "annotation_calculation" option with the "calculation" option to elgg_get_entities_from_annotation_calculation(). The "annotation_calculation" option causes this function to return the result of performing a mathematical calculation on all annotations that match the query instead of ElggAnnotation objects. See the docs for elgg_get_entities_from_annotation_calculation() for the proper use of the "calculation" option.
Definition at line 206 of file annotations.php.
elgg_get_entities_from_annotation_calculation | ( | $options | ) |
Get entities ordered by a mathematical calculation on annotation values.
array | $options | An options array: 'calculation' => The calculation to use. Must be a valid MySQL function. Defaults to sum. Result selected as 'annotation_calculation'. Don't confuse this "calculation" option with the "annotation_calculation" option to elgg_get_annotations(). This "calculation" option is applied to each entity's set of annotations and is selected as annotation_calculation for that row. See the docs for elgg_get_annotations() for proper use of the "annotation_calculation" option. 'order_by' => The order for the sorting. Defaults to 'annotation_calculation desc'. 'annotation_names' => The names of annotations on the entity. 'annotation_values' => The values of annotations on the entity. |
'metadata_names' => The name of metadata on the entity. 'metadata_values' => The value of metadata on the entitiy.
Definition at line 424 of file annotations.php.
elgg_get_entities_from_annotations | ( | array | $options = array() | ) |
Returns entities based upon annotations.
Also accepts all options available to elgg_get_entities() and elgg_get_entities_from_metadata().
Entity creation time is selected as maxtime. To sort based upon this, pass 'order_by' => 'maxtime asc' || 'maxtime desc'
array | $options | Array in format: annotation_names => null|ARR annotations names annotation_values => null|ARR annotations values annotation_name_value_pairs => null|ARR (name = 'name', value => 'value', 'operator' => '=', 'case_sensitive' => true) entries. Currently if multiple values are sent via an array (value => array('value1', 'value2') the pair's operator will be forced to "IN". annotation_name_value_pairs_operator => null|STR The operator to use for combining(name = value) OPERATOR (name = value); default AND |
annotation_case_sensitive => BOOL Overall Case sensitive
order_by_annotation => null|ARR (array('name' => 'annotation_text1', 'direction' => ASC|DESC, 'as' => text|integer),
Also supports array('name' => 'annotation_text1')
annotation_owner_guids => null|ARR guids for annotaiton owners
Definition at line 343 of file annotations.php.
elgg_list_annotations | ( | $options | ) |
Returns a rendered list of annotations with pagination.
array | $options | Annotation getter and display options. elgg_get_annotations() and elgg_list_entities(). |
Definition at line 232 of file annotations.php.
elgg_list_entities_from_annotation_calculation | ( | $options | ) |
List entities from an annotation calculation.
array | $options | An options array. |
Definition at line 464 of file annotations.php.
elgg_list_entities_from_annotations | ( | $options = array() | ) |
Returns a viewable list of entities from annotations.
array | $options | Options array |
Definition at line 399 of file annotations.php.
row_to_elggannotation | ( | $row | ) |
Convert a database row to a new ElggAnnotation.
stdClass | $row | Db row result object |
Definition at line 18 of file annotations.php.
update_annotation | ( | $annotation_id, | |
$name, | |||
$value, | |||
$value_type, | |||
$owner_guid, | |||
$access_id | |||
) |
Update an annotation.
int | $annotation_id | Annotation ID |
string | $name | Name of annotation |
string | $value | Value of annotation |
string | $value_type | Type of value |
int | $owner_guid | Owner of annotation |
int | $access_id | Access level of annotation |
Definition at line 130 of file annotations.php.