[TYPO3-mvc] Chaining: Return Domain Model Object in Setter Methods

Sebastian Michaelsen sebastian.gebhard at gmail.com
Wed Sep 8 21:10:05 CEST 2010


So much acceptance. I'll take care of putting it into the extbase_kickstarter..
Thanks!

Am 07.09.2010 13:40, schrieb Sebastian Michaelsen:
> Hey,
>
> most of you probably know that returning the object itself ($this) in its setter gives you the
> possibility to chain methods like:
>
> $me = new User();
> $me->setName('Sebastian')->setGender('Male');
>
> I wanted to ask if there is any specific reason why this is not "enabled" in extbase. When I take
> Tx_Extbase_Domain_Model_FrontendUser as an example the setters do not return anything.
>
> I'm asking because there's a feature request (http://forge.typo3.org/issues/9628) for the
> extbase_kickstarter for exactly this behaviour. It's not implemented yet, because I did not see it
> as "common" in extbase and extbase'd extensions like blog_example.
>
> Kind regards,
> Sebastian



More information about the TYPO3-project-typo3v4mvc mailing list