diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-02-09 05:09:56 -0800 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-02-09 05:09:56 -0800 |
commit | 1f4a462d84a2bda542580828d1c39bec0a5a6495 (patch) | |
tree | 28021e2dfbfe0e2309e4eee9ff07bbc8703423d0 /engine/classes/ElggEntity.php | |
parent | efb6ba4d0ab857703d721c5538150cf2a337347d (diff) | |
parent | 187fcf6c98ae723d4fb296801cc91ce7092e62c0 (diff) | |
download | elgg-1f4a462d84a2bda542580828d1c39bec0a5a6495.tar.gz elgg-1f4a462d84a2bda542580828d1c39bec0a5a6495.tar.bz2 |
Merge pull request #159 from cash/entity_load
More efficient entity loading
Diffstat (limited to 'engine/classes/ElggEntity.php')
-rw-r--r-- | engine/classes/ElggEntity.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 2fa8e9939..dc38dafbe 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -1311,12 +1311,16 @@ abstract class ElggEntity extends ElggData implements /** * Loads attributes from the entities table into the object. * - * @param int $guid GUID of Entity + * @param mixed $guid GUID of entity or stdClass object from entities table * * @return bool */ protected function load($guid) { - $row = get_entity_as_row($guid); + if ($guid instanceof stdClass) { + $row = $guid; + } else { + $row = get_entity_as_row($guid); + } if ($row) { // Create the array if necessary - all subclasses should test before creating |