From eb033fe18615fcc83d68de1c986bf828240e7cb0 Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 22 Jul 2008 11:09:20 +0000 Subject: Saving cached annotations git-svn-id: https://code.elgg.org/elgg/trunk@1487 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 9072321a3..4682d27ba 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -487,7 +487,7 @@ $this->attributes['guid'] = create_entity($this->attributes['type'], $this->attributes['subtype'], $this->attributes['owner_guid'], $this->attributes['access_id'], $this->attributes['site_guid'], $this->attributes['container_guid']); // Create a new entity (nb: using attribute array directly 'cos set function does something special!) if (!$this->attributes['guid']) throw new IOException(elgg_echo('IOException:BaseEntitySaveFailed')); - // Save any unsaved metadata + // Save any unsaved metadata TODO: How to capture extra information (access id etc) if (sizeof($this->temp_metadata) > 0) { foreach($this->temp_metadata as $name => $value) { $this->$name = $value; @@ -495,6 +495,14 @@ } } + // Save any unsaved annotations metadata. TODO: How to capture extra information (access id etc) + if (sizeof($this->temp_annotations) > 0) { + foreach($this->temp_annotations as $name => $value) { + $this->annotate($name, $value); + unset($this->temp_annotations[$name]); + } + } + // Cache object handle if ($this->attributes['guid']) cache_entity($this); -- cgit v1.2.3