diff --git a/Doctrine/Access.php b/Doctrine/Access.php index 40adbc853..29968e5f8 100644 --- a/Doctrine/Access.php +++ b/Doctrine/Access.php @@ -59,12 +59,28 @@ abstract class Doctrine_Access implements ArrayAccess { public function __get($name) { return $this->get($name); } + /** + * __isset() + * + * @param string $name + */ + public function __isset($name) { + return $this->contains($name); + } + /** + * __unset() + * + * @param string $name + */ + public function __unset($name) { + return $this->remove($name); + } /** * @param mixed $offset * @return boolean -- whether or not the data has a field $offset */ public function offsetExists($offset) { - return (bool) isset($this->data[$offset]); + return $this->contains($offset); } /** * offsetGet -- an alias of get() diff --git a/Doctrine/Record.php b/Doctrine/Record.php index 807bc8e79..c0943398f 100644 --- a/Doctrine/Record.php +++ b/Doctrine/Record.php @@ -751,12 +751,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite } } /** - * __isset + * contains * * @param string $name * @return boolean */ - public function __isset($name) { + public function contains($name) { if(isset($this->data[$name])) return true;