added Doctrine_Access::__isset() and Doctrine_Access::__unset() for complete support of magic method invocations
This commit is contained in:
parent
5f44b71af6
commit
868e0bcae7
@ -59,12 +59,28 @@ abstract class Doctrine_Access implements ArrayAccess {
|
|||||||
public function __get($name) {
|
public function __get($name) {
|
||||||
return $this->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
|
* @param mixed $offset
|
||||||
* @return boolean -- whether or not the data has a field $offset
|
* @return boolean -- whether or not the data has a field $offset
|
||||||
*/
|
*/
|
||||||
public function offsetExists($offset) {
|
public function offsetExists($offset) {
|
||||||
return (bool) isset($this->data[$offset]);
|
return $this->contains($offset);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* offsetGet -- an alias of get()
|
* offsetGet -- an alias of get()
|
||||||
|
@ -751,12 +751,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* __isset
|
* contains
|
||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function __isset($name) {
|
public function contains($name) {
|
||||||
if(isset($this->data[$name]))
|
if(isset($this->data[$name]))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user