View Single Post
Old 12-20-2009, 11:54 AM   #13 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,324
Thanks: 5
Salathe is on a distinguished road
Default

Hi Jarod, a better option (in my opinion) would be to make use of the class hierarchy rather than doing everything in one class.

E.g. (just snippets)
PHP Code:
class Person {
    protected 
$name;
    public function 
set_name($name) {
        return 
$this->name $name;
    }
}

class 
ChainablePerson extends Person {
    public function 
set_name($name) {
        
parent::set_name($name);
        return 
$this;
    }

Salathe is offline  
Reply With Quote