Permalink
Browse files

Add __isset and __unset

  • Loading branch information...
1 parent dc128f4 commit 30a521b669b48d08a974eafbeb18bffa6346d88e @saltybeagle saltybeagle committed Mar 4, 2010
Showing with 24 additions and 0 deletions.
  1. +24 −0 src/Templates/Savant/ObjectProxy.php
@@ -104,6 +104,30 @@ function __set($var, $value)
$this->object->$var = $value;
}
+ /**
+ * Magic method for checking if a property is set.
+ *
+ * @param string $var The var
+ *
+ * @return bool
+ */
+ function __isset($var)
+ {
+ return isset($this->object->$var);
+ }
+
+ /**
+ * Unset a property.
+ *
+ * @param string $var The var
+ *
+ * @return void
+ */
+ function __unset($var)
+ {
+ unset($this->object->$var);
+ }
+
/**
* Magic method which will call methods on the object.
*

0 comments on commit 30a521b

Please sign in to comment.