title: PHP OOP: Chainable objects?
body: <p>I have tried to find a good introduction on chainable OOP objects in PHP, but without any good result yet. </p>
  
  <p>How can something like this be done?</p>
  
  <pre><code>$this-&gt;className-&gt;add('1','value');
  $this-&gt;className-&gt;type('string');
  $this-&gt;classname-&gt;doStuff();
  </code></pre>
  
  <p>Or even: <code>$this-&gt;className-&gt;add('1','value')-&gt;type('string')-&gt;doStuff();</code></p>
  
  <p>Thanks a lot!</p>