aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-15 14:18:15 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-15 14:18:15 +0000
commit8d726468d9b677407259ce376fb4b31ba163b657 (patch)
treea69b292ce4c7e126e13e573f363e39107b74a205 /engine/lib
parentb1636d5c19e23c50a3cb72be2ba95a5e4c567f65 (diff)
downloadelgg-8d726468d9b677407259ce376fb4b31ba163b657.tar.gz
elgg-8d726468d9b677407259ce376fb4b31ba163b657.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Blocking create and update dates from ODD export, since these don't make sense to export. git-svn-id: https://code.elgg.org/elgg/trunk@453 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php53
1 files changed, 26 insertions, 27 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index f7816569b..4f401ebc6 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -397,22 +397,21 @@
{
switch ($k)
{
- case 'guid' : break; // Dont use guid
- case 'subtype' : break; // The subtype
- case 'type' : break; // Don't use type
- case 'access_id' : break; // Don't use access - if can export then its public for you, then importer decides what access to give this object.
+ case 'guid' : // Dont use guid
+ case 'subtype' : // The subtype
+ case 'type' : // Don't use type
+ case 'access_id' : // Don't use access - if can export then its public for you, then importer decides what access to give this object.
+ case 'time_created' : // Don't use date in export
+ case 'time_updated' : // Don't use date in export
+ break;
- case 'owner_guid' : // Convert owner guid to uuid
+ case 'owner_guid' : // Convert owner guid to uuid, this will be stored in metadata
$k = 'owner_uuid';
$v = guid_to_uuid($v);
$tmp[] = new ODDMetadata($uuid . "attr/$k/", $uuid, $k, $v);
break;
- case 'time_created' : // Convert to RFC 822
- case 'time_updated' : // Convert to RFC 822
- $v = date('r', $v);
- $tmp[] = new ODDMetadata($uuid . "attr/$k/", $uuid, $k, $v);
- break;
+
default :
$tmp[] = new ODDMetadata($uuid . "attr/$k/", $uuid, $k, $v);
@@ -837,23 +836,23 @@
}
}
}
- }
-
- if ($tmp)
- {
- if (!$tmp->import($element))
- throw new ImportException("Could not import element " . $element->getAttribute('uuid'));
-
- if (!$tmp->save()) // Make sure its saved
- throw new ImportException("There was a problem saving ". $element->getAttribute('uuid'));
-
- // Belts and braces
- if (!$tmp->guid)
- throw new ImportException("New entity created but has no GUID, this should not happen.");
- add_uuid_to_guid($tmp->guid, $element->getAttribute('uuid')); // We have saved, so now tag
-
- return $tmp;
+ if ($tmp)
+ {
+ if (!$tmp->import($element))
+ throw new ImportException("Could not import element " . $element->getAttribute('uuid'));
+
+ if (!$tmp->save()) // Make sure its saved
+ throw new ImportException("There was a problem saving ". $element->getAttribute('uuid'));
+
+ // Belts and braces
+ if (!$tmp->guid)
+ throw new ImportException("New entity created but has no GUID, this should not happen.");
+
+ add_uuid_to_guid($tmp->guid, $element->getAttribute('uuid')); // We have saved, so now tag
+
+ return $tmp;
+ }
}
}
@@ -877,7 +876,7 @@
$user = get_entity($user_guid);
}
$entity = get_entity($entity_guid);
-
+return true;
if ($entity->getOwner() == $user->getGUID()) return true;
if ($entity->type == "user" && $entity->getGUID() == $user->getGUID()) return true;