From fd05958d9d359f5e76cb42f86e2e9398f902f74c Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 5 Jun 2010 14:45:47 +0200 Subject: [PATCH] Implements __unset on PlUser. Signed-off-by: Florent Bruneau --- classes/pluser.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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. -- 2.1.4