Elgg  Version 1.9
Namespaces | Functions
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_delete_river (array $options=array())
 Delete river items. 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 ElggRiverItem. 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 ($page)
 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...
 

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

_elgg_prefetch_river_entities ( array  $river_items)

Prefetch entities that will be displayed in the river.

Parameters
ElggRiverItem[]$river_items private

Definition at line 438 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 756 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 783 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 635 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 664 of file river.php.

_elgg_river_init ( )

Initialize river library private.

Definition at line 812 of file river.php.

_elgg_river_page_handler (   $page)

Page handler for activity.

Parameters
array$page
Returns
bool private

Definition at line 713 of file river.php.

_elgg_river_test (   $hook,
  $type,
  $value 
)

Register river unit tests private.

Definition at line 741 of file river.php.

_elgg_row_to_elgg_river_item (   $row)

Convert a database row to a new ElggRiverItem.

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

Definition at line 534 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

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

Definition at line 37 of file river.php.

elgg_delete_river ( array  $options = array())

Delete river items.

Warning
not checking access (should we?)
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 views => STR|ARR River view(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

posted_time_lower => INT The lower bound on the time posted posted_time_upper => INT The upper bound on the time posted

Returns
bool
Since
1.8.0

Definition at line 168 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

Returns
array|int
Since
1.8.0

Definition at line 286 of file river.php.

elgg_list_river ( array  $options = array())

List river items.

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

Definition at line 490 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 692 of file river.php.