From ddbebe4c0ce0da3d659050707559a02757aeaeee Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 5 Jun 2010 14:47:10 +0200 Subject: [PATCH] Implements __unset on Profile. Signed-off-by: Florent Bruneau --- classes/profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/classes/profile.php b/classes/profile.php index 7c73903..4b0f30f 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -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 -- 2.1.4