From bd011bb478a9a346db70b79576e205e19dfe1875 Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 10 Oct 2010 18:56:05 +0000 Subject: 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 --- engine/classes/ElggEntity.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engine/classes/ElggEntity.php') 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; } /** -- cgit v1.2.3