aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggEntity.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-10 18:56:05 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-10 18:56:05 +0000
commitbd011bb478a9a346db70b79576e205e19dfe1875 (patch)
tree0357cb9ec0f477c3ee862d2e33af8b3da92a70d3 /engine/classes/ElggEntity.php
parent38cf151563563dd8f5fe8b5dbcda1d800997d9f6 (diff)
downloadelgg-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/classes/ElggEntity.php')
-rw-r--r--engine/classes/ElggEntity.php12
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;
}
/**