how to overload accessible methods

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

 



As we all know, __call() can overload non-accessible methods,
eg.
Class User
{
    public function __call($name, $args)
    {
        //validate user....
        $this->_validate();

        $this->_{$name}($args);
    }
    private function _validate()
    {
        //....
    }
    private function _update($args)
    {
        //....
    }
}

$user = new User();
$user->update() // will call _validate before _update automatically

BUT, if I want to make this update a public function, how can I call
the validate without call it inside update function explicitly?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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