accessing magic parent set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux