GeneratorBundle icon indicating copy to clipboard operation
GeneratorBundle copied to clipboard

Missing method when adding a `ManyToOne` association

Open jibundeyare opened this issue 8 years ago • 0 comments

When I add a ManyToOne association mapping to the Category, class between Category and Post classes, I expect the generator to add also these methods :

    /**
     * Add post
     *
     * @param \AppBundle\Entity\Post $post
     *
     * @return Post
     */
    public function addPost(\AppBundle\Entity\Post $post)
    {
        $this->posts[] = $post;

        return $this;
    }

    /**
     * Remove post
     *
     * @param \AppBundle\Entity\Post $post
     */
    public function removePost(\AppBundle\Entity\Post $post)
    {
        $this->posts->removeElement($post);
    }

Note, that I expect the same for the inverse (owned) side.

jibundeyare avatar Nov 12 '17 23:11 jibundeyare