diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-11-06 12:01:31 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-11-06 12:01:31 +0000 |
commit | 9d3a3c457c672567a65600666a44c8de594c729d (patch) | |
tree | 818b37fe9f019fb98fd389b5cb84a189d494aca8 /engine/lib/export.php | |
parent | b752befd19233618c7681ce29308cd485502dd5e (diff) | |
download | elgg-9d3a3c457c672567a65600666a44c8de594c729d.tar.gz elgg-9d3a3c457c672567a65600666a44c8de594c729d.tar.bz2 |
Some tidying of objects and opendd export
git-svn-id: https://code.elgg.org/elgg/trunk@2412 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/export.php')
-rw-r--r-- | engine/lib/export.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/engine/lib/export.php b/engine/lib/export.php index fe9d2b2da..e819264f6 100644 --- a/engine/lib/export.php +++ b/engine/lib/export.php @@ -62,6 +62,32 @@ class ImportException extends DataFormatException {} /** + * Get a UUID from a given object. + * + * @param $object The object either an ElggEntity, ElggRelationship or ElggExtender + * @return the UUID or false + */ + function get_uuid_from_object($object) + { + if ($object instanceof ElggEntity) + return guid_to_uuid($object->guid); + else if ($object instanceof ElggExtender) { + $type = $object->type; + if ($type == 'volatile') + $uuid = guid_to_uuid($object->entity_guid). $type . "/{$object->name}/"; + else + $uuid = guid_to_uuid($object->entity_guid). $type . "/{$object->id}/"; + + return $uuid; + } else if ($object instanceof ElggRelationship) { + return guid_to_uuid($object->guid_one) . "relationship/{$object->id}/"; + } + + + return false; + } + + /** * Generate a UUID from a given GUID. * * @param int $guid The GUID of an object. |