aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/annotations.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-14 09:18:17 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-14 09:18:17 +0000
commit39780175ff176d11a54c1e4e0dee2ff537790392 (patch)
tree8d35f056200660cbe82cff9e60d31b0b28c0ad4d /engine/lib/annotations.php
parent48af92966e9030431eccd0a30d277e88092e4876 (diff)
downloadelgg-39780175ff176d11a54c1e4e0dee2ff537790392.tar.gz
elgg-39780175ff176d11a54c1e4e0dee2ff537790392.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* ODD Annotation and Metadata export git-svn-id: https://code.elgg.org/elgg/trunk@439 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r--engine/lib/annotations.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 4983dcacf..1e974cc71 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -26,7 +26,7 @@
* @subpackage Core
* @author Marcus Povey <marcus@dushka.co.uk>
*/
- class ElggAnnotation extends ElggExtender
+ class ElggAnnotation extends ElggExtender implements Exportable
{
/**
@@ -100,6 +100,18 @@
return delete_annotation($this->id);
}
+ /**
+ * Export this object
+ *
+ * @return array
+ */
+ public function export()
+ {
+ $type = "annotation";
+ $uuid = guid_to_uuid($this->entity_guid). $type . "/{$this->id}/";
+
+ return new ODDMetadata($uuid, guid_to_uuid($this->entity_guid), $this->attributes[$name], $this->attributes['value'], $type, guid_to_uuid($this->owner_guid));
+ }
}
/**
@@ -427,7 +439,7 @@
function export_annotation_plugin_hook($hook, $entity_type, $returnvalue, $params)
{
// Sanity check values
-/* if ((!is_array($params)) && (!isset($params['guid'])))
+ if ((!is_array($params)) && (!isset($params['guid'])))
throw new InvalidParameterException("GUID has not been specified during export, this should never happen.");
if (!is_array($returnvalue))
@@ -441,8 +453,8 @@
if ($result)
{
foreach ($result as $r)
- $returnvalue[] = $r;
- }*/
+ $returnvalue[] = $r->export();
+ }
return $returnvalue;
}