aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/objects.php10
-rw-r--r--engine/lib/sites.php10
-rw-r--r--engine/lib/users.php10
3 files changed, 9 insertions, 21 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'));
}
/**
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 617c62386..86a99525d 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -124,7 +124,8 @@
// Load missing data
$row = get_site_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;
foreach($objarray as $key => $value)
@@ -143,12 +144,7 @@
return false;
// Now save specific stuff
- $result = create_site_entity($this->get('guid'), $this->get('name'), $this->get('description'), $this->get('url'));
-
- // Increment the portion counter
- if ($result) $this->attributes['tables_loaded'] ++;
-
- return $result;
+ return create_site_entity($this->get('guid'), $this->get('name'), $this->get('description'), $this->get('url'));
}
/**
diff --git a/engine/lib/users.php b/engine/lib/users.php
index ec22db239..33a192005 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -128,7 +128,8 @@
throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $guid, get_class()));
// Load missing data
- $row = get_user_entity_as_row($guid);
+ $row = get_user_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;
@@ -149,12 +150,7 @@
return false;
// Now save specific stuff
- $result = create_user_entity($this->get('guid'), $this->get('name'), $this->get('username'), $this->get('password'), $this->get('email'), $this->get('language'), $this->get('code'));
-
- // Increment the portion counter
- if ($result) $this->attributes['tables_loaded'] ++;
-
- return $result;
+ return create_user_entity($this->get('guid'), $this->get('name'), $this->get('username'), $this->get('password'), $this->get('email'), $this->get('language'), $this->get('code'));
}
/**