Elgg  Version master
relationships.php
Go to the documentation of this file.
1 <?php
7 
17  return _elgg_services()->relationshipsTable->get($id);
18 }
19 
31  return _elgg_services()->relationshipsTable->getEntitiesFromCount($options);
32 }
33 
45  return elgg_list_entities($options, 'elgg_get_entities_from_relationship_count');
46 }
47 
62 function elgg_get_relationships(array $options = []) {
63  return Relationships::find($options);
64 }
65 
75 function elgg_list_relationships(array $options): string {
76  $defaults = [
77  'limit' => (int) max(get_input('limit', max(25, _elgg_services()->config->default_limit)), 0),
78  'offset' => (int) max(get_input('reloff', 0), 0),
79  'sort_by' => get_input('sort_by', []),
80  ];
81 
82  $options = array_merge($defaults, $options);
83 
84  return elgg_list_entities($options, 'elgg_get_relationships', 'elgg_view_relationship_list');
85 }
elgg_list_entities_from_relationship_count(array $options)
Returns a list of entities by relationship count.
elgg_list_relationships(array $options)
Returns a rendered list of relationships with pagination.
$defaults
Generic entity header upload helper.
Definition: header.php:6
elgg_get_entities_from_relationship_count(array $options=[])
Gets the number of entities by a the number of entities related to them in a particular way...
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
Definition: language.php:20
elgg_get_relationship(int $id)
Get a relationship by its ID.
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:549
elgg_get_relationships(array $options=[])
Fetch relationships or perform a calculation on them.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:346
$id
Generic annotation delete action.
Definition: delete.php:6
Elgg relationships.