On Wed, Dec 22, 2010 at 6:35 AM, Alexandru Patranescu <dreal...@gmail.com>wrote:

> Is this the only way to access the magic __set from the parent class:
>
>    parent::__set($columnName, $value);
>

Other than referencing the parent class by name which is worse, yes.


> I would have liked to work this way:
>
>    parent::$columnName = $value;
>

The problem is that attributes are all attached to the object instance
($this). Only those that were defined by a class are associated with it. The
"parent::<method>" construct is used only to locate the method overridden by
the current method.

There is a self, a static and a parent
> Why is it only $this and not a $parent too?
>

I would guess the reasoning is that $this is a value (an object instance)
whereas the others are not.

David

Reply via email to