accessing magic parent set
| From: | Alexandru Patranescu | Date: | Wed, 22 Dec 2010 14:35:52 +0000 |
| Subject: | accessing magic parent set | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-310216@lists.php.net to get a copy of this message | ||
Is this the only way to access the magic __set from the parent class:
public function __set($columnName, $value)
{
if ($value !== $this->$columnName) {
parent::__set($columnName, $value);
}
}
I would have liked to work this way:
public function __set($columnName, $value)
{
if ($value !== $this->$columnName) {
parent::$columnName = $value;
}
}
And another question.
There is a self, a static and a parent
Why is it only $this and not a $parent too?