diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-10 18:56:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-10 18:56:05 +0000 |
commit | bd011bb478a9a346db70b79576e205e19dfe1875 (patch) | |
tree | 0357cb9ec0f477c3ee862d2e33af8b3da92a70d3 /engine | |
parent | 38cf151563563dd8f5fe8b5dbcda1d800997d9f6 (diff) | |
download | elgg-bd011bb478a9a346db70b79576e205e19dfe1875.tar.gz elgg-bd011bb478a9a346db70b79576e205e19dfe1875.tar.bz2 |
ElggEntity::disable() and enable() now update the attributes so you don't have stale data on the object.
git-svn-id: http://code.elgg.org/elgg/trunk@7048 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggEntity.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index 37722243c..80617936e 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -922,7 +922,11 @@ abstract class ElggEntity implements * @see ElggEntity::enable() */ public function disable($reason = "", $recursive = true) { - return disable_entity($this->get('guid'), $reason, $recursive); + if ($r = disable_entity($this->get('guid'), $reason, $recursive)) { + $this->attributes['enabled'] = 'no'; + } + + return $r; } /** @@ -936,7 +940,11 @@ abstract class ElggEntity implements * @return bool */ public function enable() { - return enable_entity($this->get('guid')); + if ($r = enable_entity($this->get('guid'))) { + $this->attributes['enabled'] = 'yes'; + } + + return $r; } /** |