diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-30 11:20:10 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-30 11:20:10 +0000 |
commit | c0412aa41a1efe0be21bdd6807280b6a55005053 (patch) | |
tree | 44804a801abed2909b6e35e7a1296d525e2a43ba /engine/lib/entities.php | |
parent | f1ab5b38c75ad4cad18cf6f53f5e22b70441b4b5 (diff) | |
download | elgg-c0412aa41a1efe0be21bdd6807280b6a55005053.tar.gz elgg-c0412aa41a1efe0be21bdd6807280b6a55005053.tar.bz2 |
Introducing getEntitiesFromRelationship and countEntitiesFromRelationship methods on ElggEntity
git-svn-id: https://code.elgg.org/elgg/trunk@577 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 22 |
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)
|