GeneratorBundle
GeneratorBundle copied to clipboard
Expecting fluent design pattern on every setter methods
When I add a *ToMany association mapping on the Tag class, between Tag and Post classes, the generator creates a remove*() method wich does not return $this :
/**
* Remove post
*
* @param \AppBundle\Entity\Post $post
*/
public function removePost(\AppBundle\Entity\Post $post)
{
$this->posts->removeElement($post);
}
This is better :
/**
* Remove post
*
* @param \AppBundle\Entity\Post $post
*
* @return Tag
*/
public function removePost(\AppBundle\Entity\Post $post)
{
$this->posts->removeElement($post);
return $this;
}