diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-14 09:18:17 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-14 09:18:17 +0000 |
commit | 39780175ff176d11a54c1e4e0dee2ff537790392 (patch) | |
tree | 8d35f056200660cbe82cff9e60d31b0b28c0ad4d /engine/lib/metadata.php | |
parent | 48af92966e9030431eccd0a30d277e88092e4876 (diff) | |
download | elgg-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/metadata.php')
-rw-r--r-- | engine/lib/metadata.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 50bcf2c53..727d68f41 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -19,7 +19,7 @@ * @package Elgg * @subpackage Core */ - class ElggMetadata extends ElggExtender + class ElggMetadata extends ElggExtender implements Exportable { /** @@ -94,9 +94,19 @@ { return delete_metadata($this->id); } -
-
- + + /** + * Export this object + * + * @return array + */ + public function export() + { + $type = "metadata"; + $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)); + } }
/** @@ -361,7 +371,7 @@ */ function export_metadata_plugin_hook($hook, $entity_type, $returnvalue, $params) { - /* // Sanity check values + // Sanity check values if ((!is_array($params)) && (!isset($params['guid']))) throw new InvalidParameterException("GUID has not been specified during export, this should never happen."); @@ -376,9 +386,9 @@ if ($result) { foreach ($result as $r) - $returnvalue[] = $r; + $returnvalue[] = $r->export(); } - */ + return $returnvalue; } |