Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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_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 . 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...
 

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 578 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 451 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 776 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 803 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 656 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 685 of file river.php.

_elgg_river_init ( )

Initialize river library private.

Definition at line 832 of file river.php.

_elgg_river_page_handler (   $page)

Page handler for activity.

Parameters
array$page
Returns
bool private

Definition at line 734 of file river.php.

_elgg_river_test (   $hook,
  $type,
  $value 
)

Register river unit tests private.

Definition at line 761 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 555 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 162 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)

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: 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 512 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 713 of file river.php.

Variable Documentation

Definition at line 850 of file river.php.