Deferred chain
A few months ago, I wrote a small PHP class to help me create chainable interfaces (PHP people like to call these “fluent interfaces”) without having to retrofit old code. I call this DeferredChain.
Here is the source for DeferredChain.