aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggObject.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2014-01-22 03:37:52 +0100
committerSem <sembrestels@riseup.net>2014-01-22 03:37:52 +0100
commit4a2ed114bb18c5363f594a380676c5654f4165a4 (patch)
tree3a37094b249c40e3e6bf122691db53115f65f8f0 /engine/classes/ElggObject.php
parent673932bc46a3918293a28c2c2fc622b3e5ff6bde (diff)
parent0dd36c458d41e77521c36ae572fe73114ad4bc5a (diff)
downloadelgg-4a2ed114bb18c5363f594a380676c5654f4165a4.tar.gz
elgg-4a2ed114bb18c5363f594a380676c5654f4165a4.tar.bz2
Merge tag '1.8.18' of git://github.com/Elgg/Elgg into develop
1.8.18 Conflicts: mod/tinymce/vendor/tinymce/jscripts/tiny_mce/langs/en.js mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js
Diffstat (limited to 'engine/classes/ElggObject.php')
-rw-r--r--engine/classes/ElggObject.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/engine/classes/ElggObject.php b/engine/classes/ElggObject.php
index 6263f84f6..aeaa3ba5c 100644
--- a/engine/classes/ElggObject.php
+++ b/engine/classes/ElggObject.php
@@ -66,21 +66,18 @@ class ElggObject extends ElggEntity {
$msg = elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid->guid));
throw new IOException($msg);
}
-
- // Is $guid is an ElggObject? Use a copy constructor
} else if ($guid instanceof ElggObject) {
+ // $guid is an ElggObject so this is a copy constructor
elgg_deprecated_notice('This type of usage of the ElggObject constructor was deprecated. Please use the clone method.', 1.7);
foreach ($guid->attributes as $key => $value) {
$this->attributes[$key] = $value;
}
-
- // Is this is an ElggEntity but not an ElggObject = ERROR!
} else if ($guid instanceof ElggEntity) {
+ // @todo remove - do not need separate exception
throw new InvalidParameterException(elgg_echo('InvalidParameterException:NonElggObject'));
-
- // Is it a GUID
} else if (is_numeric($guid)) {
+ // $guid is a GUID so load
if (!$this->load($guid)) {
throw new IOException(elgg_echo('IOException:FailedToLoadGUID', array(get_class(), $guid)));
}
@@ -110,7 +107,7 @@ class ElggObject extends ElggEntity {
$this->attributes = $attrs;
$this->attributes['tables_loaded'] = 2;
- cache_entity($this);
+ _elgg_cache_entity($this);
return true;
}
@@ -129,8 +126,12 @@ class ElggObject extends ElggEntity {
}
// Save ElggObject-specific attributes
- return create_object_entity($this->get('guid'), $this->get('title'),
- $this->get('description'));
+
+ _elgg_disable_caching_for_entity($this->guid);
+ $ret = create_object_entity($this->get('guid'), $this->get('title'), $this->get('description'));
+ _elgg_enable_caching_for_entity($this->guid);
+
+ return $ret;
}
/**