PHP OOP: Chainable objects?

Posted by Industrial on Stack Overflow See other posts from Stack Overflow or by Industrial
Published on 2010-05-28T14:37:14Z Indexed on 2010/05/28 14:41 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

Hi everybody,

I have tried to find a good introduction on chainable OOP objects in PHP, but without any good result yet.

How can something like this be done?

$this->className->add('1','value');
$this->className->type('string');
$this->classname->doStuff();

Or even: $this->className->add('1','value')->type('string')->doStuff();

Thanks a lot!

© Stack Overflow or respective owner

Related posts about php

Related posts about oop