[DDC-1518] Method chaining in Setters of generated entity classes Created: 02/Dec/11  Updated: 09/Jan/14  Resolved: 09/Jan/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: None
Fix Version/s: 2.3.1
Security Level: All

Type: Improvement Priority: Minor
Reporter: Christian Stoller Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Symfony2



 Description   

Hi.
It would be nice if the set-methods of the generated entity classes would return the entity instance itself, so that method chaining is possible.
Example:

$user = new User();
$user->setUsername()
     ->setFirstname()
     ->setEmail();

In PHP 5.4 we can do even more nicer:

$user = new User()
     ->setUsername()
     ->setFirstname()
     ->setEmail();

If this is not wanted by everyone, the console tool could get a new argument to define if method chaining should be used or not.

Implementation of this improvement would be very nice. Thanks.



 Comments   
Comment by Christian Stoller [ 09/Jan/14 ]

This has already been fixed

Generated at Fri Sep 19 19:53:24 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.