From: Florent Bruneau Date: Sat, 5 Jun 2010 12:45:47 +0000 (+0200) Subject: Implements __unset on PlUser. X-Git-Tag: core/1.1.0~13 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=fd05958d9d359f5e76cb42f86e2e9398f902f74c;p=platal.git Implements __unset on PlUser. Signed-off-by: Florent Bruneau --- diff --git a/classes/pluser.php b/classes/pluser.php index 03abb2a..c4ae622 100644 --- a/classes/pluser.php +++ b/classes/pluser.php @@ -192,6 +192,15 @@ abstract class PlUser return property_exists($this, $name) || isset($this->data[$name]); } + public function __unset($name) + { + if (property_exists($this, $name)) { + $this->$name = null; + } else { + unset($this->data[$name]); + } + } + /** * Fills the object properties using the @p associative array; the intended * user case is to fill the object using SQL obtained arrays.