aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/objects.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r--engine/lib/objects.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 19b264d1c..f838308f4 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -114,7 +114,8 @@
throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class()));
// Load missing data
- $row = get_object_entity_as_row($guid);
+ $row = get_object_entity_as_row($guid);
+ if (($row) && (!$this->isFullyLoaded())) $this->attributes['tables_loaded'] ++; // If $row isn't a cached copy then increment the counter
// Now put these into the attributes array as core values
$objarray = (array) $row;
@@ -135,12 +136,7 @@
return false;
// Now save specific stuff
- $result = create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'));
-
- // Increment the portion counter
- if ($result) $this->attributes['tables_loaded'] ++;
-
- return $result;
+ return create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'));
}
/**