Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1518

Method chaining in Setters of generated entity classes

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 2.3.1
    • Component/s: Tools
    • Security Level: All
    • 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.

        Activity

        Christian S. created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13236 ] jira-feedback [ 13995 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13995 ] jira-feedback2 [ 15859 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15859 ] jira-feedback3 [ 18115 ]
        Christian S. made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.1 [ 10323 ]
        Resolution Duplicate [ 3 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Christian S.
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: