Calling magic methods directly inside the class
Posted: Sun Dec 16, 2007 7:08 am
Code: Select all
class cls
{
private $m1;
public function __construct($m1)
{
$this->__set('m1', $m1); // self::__set('m1', $m1);
}
public function __set($name, $value)
{
switch ($name)
{
case "m1":
// Long procedure to set m1
break;
}
}
}Thanks