What is the purpose of return'ing $this when setting vars in the model
- by TaMeR
I am a self thought hobby programmer and therefore don't have the fundamentals always down the way you professionals do. So please excuse me if this is basic.
What is the purpose or benefit of return'ing $this when setting vars in the model.
I have seen this done in other places too but cant figure this out.
Sample code:
public function setAlias($Alias){
$this->_Alias = (string) $Alias;
return $this;
}
public function getAlias(){
return $this->_Alias;
}