Elgg  Version 3.0
Namespaces | Functions | Variables
river.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 elgg_create_river_item (array $options=[])
 Adds an item to the river. More...
 
 elgg_get_river (array $options=[])
 Get river items. More...
 
 elgg_get_river_item_from_id ($id)
 Get river item from its ID. More...
 
 elgg_delete_river (array $options=[])
 Delete river items based on $options. More...
 
 elgg_list_river (array $options=[])
 List river items. More...
 
 _elgg_river_test ($hook, $type, $value)
 Register river unit tests. More...
 
 _elgg_river_update_object_last_action ($event, $type, $item)
 Updates the last action of the object of an river item. More...
 
 _elgg_river_disable ($event, $type, $entity)
 Disable river entries that reference a disabled entity as subject/object/target. More...
 
 _elgg_river_enable ($event, $type, $entity)
 Enable river entries that reference a re-enabled entity as subject/object/target. More...
 
 _elgg_river_menu_setup (\Elgg\Hook $hook)
 Add the delete to river actions menu. More...
 
 _elgg_river_init ()
 Initialize river library. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_river_disable (   $event,
  $type,
  $entity 
)

Disable river entries that reference a disabled entity as subject/object/target.

Parameters
string$event'disable'
string$type'all'
ElggEntity$entityThe entity being disabled
Returns
void

Definition at line 357 of file river.php.

_elgg_river_enable (   $event,
  $type,
  $entity 
)

Enable river entries that reference a re-enabled entity as subject/object/target.

Parameters
string$event'enable'
string$type'all'
ElggEntity$entityThe entity being enabled
Returns
void

Definition at line 386 of file river.php.

_elgg_river_init ( )

Initialize river library.

Returns
void

Definition at line 456 of file river.php.

_elgg_river_menu_setup ( \Elgg\Hook  $hook)

Add the delete to river actions menu.

Parameters
\Elgg\Hook$hook'register' 'menu:river'
Returns
void|ElggMenuItem[]

Definition at line 420 of file river.php.

_elgg_river_test (   $hook,
  $type,
  $value 
)

Register river unit tests.

Parameters
string$hook'unit_test'
string$type'system'
array$valuecurrent return value
Returns
array

Definition at line 317 of file river.php.

_elgg_river_update_object_last_action (   $event,
  $type,
  $item 
)

Updates the last action of the object of an river item.

Parameters
string$event'create'
string$type'river'
\ElggRiverItem$itemThe entity being disabled
Returns
void

Definition at line 333 of file river.php.

elgg_create_river_item ( array  $options = [])

Adds an item to the river.

Read the item like "Lisa (subject) posted (action) a comment (object) on John's blog (target)".

Parameters
array$optionsArray in format:

string $view The view that will handle the river item string $action_type An arbitrary string to define the action (eg 'comment', 'create') int $subject_guid The GUID of the entity doing the action (default: current logged in user guid) int $object_guid The GUID of the entity being acted upon int $target_guid The GUID of the the object entity's container int $posted The UNIX epoch timestamp of the river item (default: now) int $annotation_id The annotation ID associated with this river entry bool $return_item set to true to return the ElggRiverItem created

Returns
int|ElggRiverItem|bool River ID/item or false on failure
Since
1.9
Exceptions
DatabaseException

Definition at line 33 of file river.php.

elgg_delete_river ( array  $options = [])

Delete river items based on $options.

Warning
Unlike elgg_get_river() this will not accept an empty options array! This requires at least one constraint: id(s), annotation_id(s) subject_guid(s), object_guid(s), target_guid(s) or view(s) must be set.

Access is ignored during the execution of this function. Intended usage of this function is to cleanup river content. For an example see actions/avatar/upload.

Parameters
array$optionsAn options array. elgg_get_river()
Returns
bool|null true on success, false on failure, null if no metadata to delete.
Since
1.8.0

Definition at line 220 of file river.php.

elgg_get_river ( array  $options = [])

Get river items.

Note
If using types and subtypes in a query, they are joined with an AND.
Parameters
array$optionsParameters: ids => INT|ARR River item id(s) subject_guids => INT|ARR Subject guid(s) object_guids => INT|ARR Object guid(s) target_guids => INT|ARR Target guid(s) action_types => STR|ARR The river action type(s) identifier posted_time_lower => INT The lower bound on the time posted posted_time_upper => INT The upper bound on the time posted

Additionally accepts all "annotation_*" options supported by elgg_get_entities() annotation_ids => INT|ARR The identifier of the annotation(s)

types => STR|ARR Entity type string(s) subtypes => STR|ARR Entity subtype string(s) type_subtype_pairs => ARR Array of type => subtype pairs where subtype can be an array of subtype strings

Additionally accepts all "relationship_*" options supported by elgg_get_entities() relationship => STR Relationship identifier relationship_guid => INT|ARR Entity guid(s) inverse_relationship => BOOL Subject or object of the relationship (false) relationship_join_on => STR subject_guid|object_guid|target_guid (defaults to subject_guid)

limit => INT Number to show per page (20) offset => INT Offset in list (0) count => BOOL Count the river items? (false) order_by => STR Order by clause (rv.posted desc) group_by => STR Group by clause

distinct => BOOL If set to false, Elgg will drop the DISTINCT clause from the MySQL query, which will improve performance in some situations. Avoid setting this option without a full understanding of the underlying SQL query Elgg creates. (true)

batch => BOOL If set to true, an Elgg object will be returned instead of an array. (false) Since 2.3.

batch_inc_offset => BOOL If "batch" is used, this tells the batch to increment the offset on each fetch. This must be set to false if you delete the batched results. (true)

batch_size => INT If "batch" is used, this is the number of entities/rows to pull in before requesting more. (25)

Returns
[]||array|int
Since
1.8.0

Definition at line 184 of file river.php.

elgg_get_river_item_from_id (   $id)

Get river item from its ID.

Parameters
int$idID
Returns
ElggRiverItem|false

Definition at line 194 of file river.php.

elgg_list_river ( array  $options = [])

List river items.

Parameters
array$optionsAny options from elgg_get_river() plus: item_view => STR Alternative view to render list items pagination => BOOL Display pagination links (true) no_results => STR|true|Closure Message to display if no items
Returns
string
Since
1.8.0

Definition at line 261 of file river.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 467 of file river.php.