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

        Hide
        Christian Stoller added a comment -

        This has already been fixed

        Show
        Christian Stoller added a comment - This has already been fixed

          People

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

            Dates

            • Created:
              Updated:
              Resolved: