aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index d71cf2170..9d4e9c538 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -253,6 +253,28 @@
}
/**
+ * Gets an array of entities from a specific relationship type
+ *
+ * @param string $relationship Relationship type (eg "friends")
+ * @param int $limit Number of elements to return
+ * @param int $offset Indexing offset
+ * @return array|false An array of entities or false on failure
+ */
+ function getEntitiesFromRelationship($relationship, $limit = 50, $offset = 0) {
+ return get_entities_from_relationship($relationship,$this->getGUID(),false,"","",9,"time_created desc",$limit,$offset);
+ }
+
+ /**
+ * Gets the number of of entities from a specific relationship type
+ *
+ * @param string $relationship Relationship type (eg "friends")
+ * @return int|false The number of entities or false on failure
+ */
+ function countEntitiesFromRelationship($relationship) {
+ return get_entities_from_relationship($relationship,$this->getGUID(),false,"","",9,"time_created desc",$limit,$offset,true);
+ }
+
+ /**
* Determines whether or not the specified user (by default the current one) can edit the entity
*
* @param int $user_guid The user GUID, optionally (defaults to the currently logged in user)