]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
ElggEntity::disable() and enable() now update the attributes so you don't have stale...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 10 Oct 2010 18:56:05 +0000 (18:56 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 10 Oct 2010 18:56:05 +0000 (18:56 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7048 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php

index 37722243cc703515eb015ebc7719d500813f6565..80617936e4993f13e4349d44ca2bbbdb47686199 100644 (file)
@@ -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;
        }
 
        /**