CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #9628

Setter chaining in domain model

Added by Georg Grossberger over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2010-09-07
Priority:Should have Due date:
Assignee:Sebastian Michaelsen % Done:

0%

Category:Code Creation
Target version:0.1
Votes: 0

Description

I find setter chaining something handy and convenient. Since the generated setters have no return value, it would be easy to add one. The patch below adds a return $this; line to every setter and the right doc block comments.

It simply changes eg.:

    /**
     * Setter for somevalue 
     *
     * @param string $somevalue somevalue 
     * @return void
     */
    public function setSomevalue($somevalue) {
        $this->somevalue = $somevalue;
    }

to

    /**
     * Setter for somevalue 
     *
     * @param string $somevalue somevalue 
     * @return Tx_Someext_Domain_Model_Somemodel
     */
    public function setSomevalue($somevalue) {
        $this->somevalue = $somevalue;
        return $this;
    }

extbase_kickstarter_rev37681.patch - Patch for adding the needed code to the domain_model code template. (1.7 kB) Georg Grossberger, 2010-09-07 13:12

History

Updated by Sebastian Michaelsen over 2 years ago

  • Status changed from New to Accepted
  • Priority changed from Could have to Should have
  • Target version set to 0.1

Updated by Rens Admiraal over 2 years ago

  • Status changed from Accepted to Resolved

Solved in current trunk

Also available in: Atom PDF