diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-02 12:40:38 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-02 12:40:38 +0000 |
commit | 4cf87cd1f558593fe7047440806bc6b7d32e83ee (patch) | |
tree | eff1ceef115a0977cfc8988f6ca88ae3afd455e7 /engine/lib/relationships.php | |
parent | db727a00f06d95da0b6d3a3356b1d60c01feabe3 (diff) | |
download | elgg-4cf87cd1f558593fe7047440806bc6b7d32e83ee.tar.gz elgg-4cf87cd1f558593fe7047440806bc6b7d32e83ee.tar.bz2 |
The system now uses the site GUID to get and set entity data. Also, installation is a great deal more visual.
git-svn-id: https://code.elgg.org/elgg/trunk@621 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r-- | engine/lib/relationships.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 486005c3f..8e3298a61 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -371,9 +371,10 @@ * @param int $limit * @param int $offset
* @param boolean $count Set to true if you want to count the number of entities instead (default false)
+ * @param int $site_guid The site to get entities for. Leave as 0 (default) for the current site; -1 for all sites.
* @return array|int|false An array of entities, or the number of entities, or false on failure */ - function get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $order_by = "time_created desc", $limit = 10, $offset = 0, $count = false) + function get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $order_by = "time_created desc", $limit = 10, $offset = 0, $count = false, $site_guid = 0) { global $CONFIG; @@ -385,7 +386,10 @@ $owner_guid = (int)$owner_guid; $order_by = sanitise_string($order_by); $limit = (int)$limit; - $offset = (int)$offset; + $offset = (int)$offset;
+ $site_guid = (int) $site_guid;
+ if ($site_guid == 0)
+ $site_guid = $CONFIG->site_guid; $access = get_access_list(); @@ -400,7 +404,9 @@ if ($subtype) $where[] = "e.subtype=$subtype"; if ($owner_guid != "") - $where[] = "e.owner_guid='$owner_guid'"; + $where[] = "e.owner_guid='$owner_guid'";
+ if ($site_guid > 0)
+ $where[] = "e.site_guid = {$site_guid}"; // Select what we're joining based on the options $joinon = "e.guid = r.guid_one"; |