View Single Post
Old 11-28-2008, 04:17 AM   #10 (permalink)
zxt3st
The Addict
 
zxt3st's Avatar
 
Join Date: Apr 2008
Posts: 206
Thanks: 18
zxt3st is on a distinguished road
Default

well, as i study some of the articles regarding classes, i have read about this technique wherein you return the object so that you can do the chain.

e.g
the object is the cat then we apply some color on it. Yellow after which return the object again, so we can again apply any other property on it.

Cat(object)->yellow(color)->Cat(returned object)->etc..

so any instances if we apply it to classes we can do the chain as what discuss above.(if im not mistaken about it)

PHP Code:
$obj = new object();
$obj->setname(params)->setcolor(params)->setsize(params)->etc.. 
Thanks for the share, atleast we also have a detail discussion about it too :)
__________________
Serenity Project - 5% (Layout) - Ongoing....
Project Serenity Free Life!....
zxt3st is offline  
Reply With Quote