Skip to content

Commit

Permalink
Add __isset and __unset
Browse files Browse the repository at this point in the history
  • Loading branch information
saltybeagle committed Mar 4, 2010
1 parent dc128f4 commit 30a521b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Templates/Savant/ObjectProxy.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit 30a521b

Please sign in to comment.