From: brettp Date: Sun, 10 Oct 2010 18:56:05 +0000 (+0000) Subject: ElggEntity::disable() and enable() now update the attributes so you don't have stale... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=bd011bb478a9a346db70b79576e205e19dfe1875;p=lorea%2Felgg.git 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 --- 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; } /**