Implements __unset on Profile.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 5 Jun 2010 12:47:10 +0000 (14:47 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 5 Jun 2010 12:48:52 +0000 (14:48 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php

index 7c73903..4b0f30f 100644 (file)
@@ -357,6 +357,16 @@ class Profile
         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]);
+        }
+    }
+
+
     /** Sets the level of visibility of the profile
      * Sets $this->visibility to a list of valid visibilities.
      * @param one of the self::VIS_* values