aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-11 14:34:50 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-11 14:34:50 +0000
commitb6f77aa9b7c4083167cb954196d737c1c45436d2 (patch)
treeea3d5de781bef7362379afd4f13023a4e8adbc66
parentcdd5fa899d747c20cc4de20d713d247946940739 (diff)
downloadelgg-b6f77aa9b7c4083167cb954196d737c1c45436d2.tar.gz
elgg-b6f77aa9b7c4083167cb954196d737c1c45436d2.tar.bz2
relationships are addressable and have working UUIDs, refs #132
git-svn-id: https://code.elgg.org/elgg/trunk@1401 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/relationships.php11
-rw-r--r--services/export/handler.php2
2 files changed, 10 insertions, 3 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 4d0db5d66..5313aa841 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -116,12 +116,19 @@
* @return array
*/
public function export()
- {
- return new ODDRelationship(
+ {
+ global $CONFIG;
+
+ $uuid = $CONFIG->wwwroot . "odd/{$this->guid_one}/relationship/{$this->id}/";
+ $relationship = new ODDRelationship(
guid_to_uuid($this->guid_one),
$this->relationship,
guid_to_uuid($this->guid_two)
);
+
+ $relationship->setAttribute('uuid', $uuid);
+
+ return $relationship;
}
// IMPORTABLE INTERFACE ////////////////////////////////////////////////////////////
diff --git a/services/export/handler.php b/services/export/handler.php
index 9e7c5fe26..f37921bef 100644
--- a/services/export/handler.php
+++ b/services/export/handler.php
@@ -92,7 +92,7 @@
if ($r)
{
if (
- ($r->guid_one!=$entity->guid) ||
+ ($r->guid_one!=$entity->guid) &&
($r->guid_two!=$entity->guid)
)
throw new InvalidParameterException(elgg_echo('InvalidParameterException:DoesNotBelongOrRefer'));