title: PhpStorm - setting setters and getters
body: <p>PhpStorm has a useful feature when quickly creating setters and getters:</p>
  
  <pre><code>Code -&gt; generate -&gt; select the items to generate 
  </code></pre>
  
  <p><strong>This is great for setting basic setters/getters.</strong></p>
  
  <p>However from time to time I want to set more than just setters and getters. For instance I may want to create setters and getters for a one to many or many to many relationship.</p>
  
  <p>i.e. </p>
  
  <p><strong>Many to many</strong></p>
  
  <pre><code>/**
   * {@inheritDoc}
   */
  public function getOwner()
  {
      return $this-&gt;owner-&gt;toArray();
  }
  
  /**
   * Set the list of user
   * @param Collection $owner
   */
  public function setOwner( Collection $owner )
  {
      $this-&gt;registeredUsers-&gt;clear();
  
      foreach ( $owner as $item ) {
          $this-&gt;owner[] = $item;
      }
  }
  
  /**
   * Add merchant to the collection
   * @param Collection $owner
   */
  public function addOwner( Collection $owner )
  {
      foreach( $owner as $item ) {
          $this-&gt;owner-&gt;add( $item );
      }
  }
  
  /**
   * @param Collection $owner
   */
  public function removeOwner( Collection $owner )
  {
      foreach( $owner as $item ) {
          $this-&gt;owner-&gt;removeElement( $item );
      }
  }
  </code></pre>
  
  <p>Is there a way to do this via the same code generation process?</p>