11-28-2008, 04:17 AM
|
#10 (permalink)
|
|
The Addict
Join Date: Apr 2008
Posts: 206
Thanks: 18
|
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 :)
|
|
|
|