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

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

Functions

 elgg_create_river_item (array $options=array())
 Adds an item to the river. More...
 
 elgg_get_river (array $options=array())
 Get river items. More...
 
 _elgg_prefetch_river_entities (array $river_items)
 Prefetch entities that will be displayed in the river. More...
 
 elgg_list_river (array $options=array())
 List river items. More...
 
 _elgg_row_to_elgg_river_item ($row)
 Convert a database row to a new . More...
 
 _elgg_get_river_type_subtype_where_sql ($table, $types, $subtypes, $pairs)
 Returns SQL where clause for type and subtype on river table. More...
 
 _elgg_river_get_action_where_sql ($types)
 Get the where clause based on river action type strings. More...
 
 _elgg_river_get_view_where_sql ($views)
 Get the where clause based on river view strings. More...
 
 update_river_access_by_object ($object_guid, $access_id)
 Sets the access ID on river items for a particular object. More...
 
 _elgg_river_page_handler ($segments)
 Page handler for activity. More...
 
 _elgg_river_test ($hook, $type, $value)
 Register river unit tests private. 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_init ()
 Initialize river library private. More...
 

Variables

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

Function Documentation

_elgg_get_river_type_subtype_where_sql (   $table,
  $types,
  $subtypes,
  $pairs 
)

Returns SQL where clause for type and subtype on river table.

Definition at line 517 of file river.php.

_elgg_prefetch_river_entities ( array  $river_items)

Prefetch entities that will be displayed in the river.

Parameters

Definition at line 380 of file river.php.

_elgg_river_disable (   $event,
  $type,
  $entity 
)

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

Parameters
string$eventThe event 'disable'
string$typeType of entity being disabled 'all'
mixed$entityThe entity being disabled
Returns
boolean private

Definition at line 717 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$eventThe event 'enable'
string$typeType of entity being enabled 'all'
mixed$entityThe entity being enabled
Returns
boolean private

Definition at line 744 of file river.php.

_elgg_river_get_action_where_sql (   $types)

Get the where clause based on river action type strings.

Parameters
array$typesArray of action type strings
Returns
string
Since
1.8.0 private

Definition at line 595 of file river.php.

_elgg_river_get_view_where_sql (   $views)

Get the where clause based on river view strings.

Parameters
array$viewsArray of view strings
Returns
string
Since
1.8.0 private

Definition at line 624 of file river.php.

_elgg_river_init ( )

Initialize river library private.

Definition at line 773 of file river.php.

_elgg_river_page_handler (   $segments)

Page handler for activity.

Parameters
array$segmentsURL segments
Returns
private

Definition at line 676 of file river.php.

_elgg_river_test (   $hook,
  $type,
  $value 
)

Register river unit tests private.

Definition at line 702 of file river.php.

_elgg_row_to_elgg_river_item (   $row)

Convert a database row to a new .

Parameters
\stdClass$rowDatabase row from the river table
Returns
Since
1.8.0 private

Definition at line 494 of file river.php.

elgg_create_river_item ( array  $options = array())

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:
view => STR The view that will handle the river item (must exist)

action_type => STR An arbitrary string to define the action (eg 'comment', 'create')

subject_guid => INT The GUID of the entity doing the action

object_guid => INT The GUID of the entity being acted upon

target_guid => INT The GUID of the the object entity's container

access_id => INT The access ID of the river item (default: same as the object)

posted => INT The UNIX epoch timestamp of the river item (default: now)

annotation_id INT The annotation ID associated with this river entry

return_item => BOOL set to true to return the ElggRiverItem created

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

Definition at line 39 of file river.php.

elgg_get_river ( array  $options = array())

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) annotation_ids => INT|ARR The identifier of the annotation(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

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

relationship => STR Relationship identifier relationship_guid => INT|ARR Entity guid(s) inverse_relationship => BOOL Subject or object of the relationship (false)

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 197 of file river.php.

elgg_list_river ( array  $options = array())

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|Closure Message to display if no items
Returns
string
Since
1.8.0

Definition at line 441 of file river.php.

update_river_access_by_object (   $object_guid,
  $access_id 
)

Sets the access ID on river items for a particular object.

Parameters
int$object_guidThe GUID of the entity
int$access_idThe access ID
Returns
bool Depending on success

Definition at line 652 of file river.php.

Variable Documentation

Definition at line 791 of file river.php.