Elgg
Version 3.0
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Updates the advanced settings for the primary site object. | |
Functions | |
get_relationship ($id) | |
Get a relationship by its ID. More... | |
delete_relationship ($id) | |
Delete a relationship by its ID. More... | |
add_entity_relationship ($guid_one, $relationship, $guid_two) | |
Create a relationship between two entities. More... | |
check_entity_relationship ($guid_one, $relationship, $guid_two) | |
Check if a relationship exists between two entities. More... | |
remove_entity_relationship ($guid_one, $relationship, $guid_two) | |
Delete a relationship between two entities. More... | |
remove_entity_relationships ($guid, $relationship="", $inverse_relationship=false, $type= '') | |
Removes all relationships originating from a particular entity. More... | |
get_entity_relationships ($guid, $inverse_relationship=false) | |
Get all the relationships for a given GUID. More... | |
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. More... | |
elgg_list_entities_from_relationship_count ($options) | |
Returns a list of entities by relationship count. More... | |
_elgg_relationships_test ($hook, $type, $tests) | |
Register relationship unit tests. More... | |
_elgg_relationship_init () | |
Initialize the relationship library. More... | |
Variables | |
return | function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
_elgg_relationship_init | ( | ) |
_elgg_relationships_test | ( | $hook, | |
$type, | |||
$tests | |||
) |
Register relationship unit tests.
string | $hook | 'unit_test' |
string | $type | 'system' |
array | $tests | current return value |
Definition at line 147 of file relationships.php.
add_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Create a relationship between two entities.
E.g. friendship, group membership, site membership.
This function lets you make the statement "$guid_one is a $relationship of $guid_two". In the statement, $guid_one is the subject of the relationship, $guid_two is the target, and $relationship is the type.
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
InvalidArgumentException |
Definition at line 45 of file relationships.php.
check_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Check if a relationship exists between two entities.
If so, the relationship object is returned.
This function lets you ask "Is $guid_one a $relationship of $guid_two?"
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
Definition at line 60 of file relationships.php.
delete_relationship | ( | $id | ) |
Delete a relationship by its ID.
int | $id | The relationship ID |
Definition at line 27 of file relationships.php.
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.
This is a good way to get out the users with the most friends, or the groups with the most members.
array | $options | An options array compatible with elgg_get_entities_from_relationship() |
Definition at line 117 of file relationships.php.
elgg_list_entities_from_relationship_count | ( | $options | ) |
Returns a list of entities by relationship count.
array | $options | Options array |
Definition at line 131 of file relationships.php.
get_entity_relationships | ( | $guid, | |
$inverse_relationship = false |
|||
) |
Get all the relationships for a given GUID.
int | $guid | GUID of the subject or target entity (see $inverse) |
bool | $inverse_relationship | Is $guid the target of the relationships? By default $guid is the subject of the relationships. |
Definition at line 103 of file relationships.php.
get_relationship | ( | $id | ) |
Get a relationship by its ID.
int | $id | The relationship ID |
Definition at line 16 of file relationships.php.
remove_entity_relationship | ( | $guid_one, | |
$relationship, | |||
$guid_two | |||
) |
Delete a relationship between two entities.
This function lets you say "$guid_one is no longer a $relationship of $guid_two."
int | $guid_one | GUID of the subject entity of the relationship |
string | $relationship | Type of the relationship |
int | $guid_two | GUID of the target entity of the relationship |
Definition at line 75 of file relationships.php.
remove_entity_relationships | ( | $guid, | |
$relationship = "" , |
|||
$inverse_relationship = false , |
|||
$type = '' |
|||
) |
Removes all relationships originating from a particular entity.
int | $guid | GUID of the subject or target entity (see $inverse) |
string | $relationship | Type of the relationship (optional, default is all relationships) |
bool | $inverse_relationship | Is $guid the target of the deleted relationships? By default, $guid is the subject of the relationships. |
string | $type | The type of entity related to $guid (defaults to all) |
Definition at line 90 of file relationships.php.
return function(\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
Definition at line 167 of file relationships.php.