Persistence with embedded forms

后端 未结 1 1543
情歌与酒
情歌与酒 2021-01-19 03:17

I am trying to set up some embedded forms using this guide. I have two models set up in my application, Lesson and Evaluation.

Each Lesson can have multiple Evaluati

1条回答
  •  情歌与酒
    2021-01-19 03:43

    In your class Lesson entity add:

    /**
     * Add evaluations
     *
     * @param \DS\LessonBundle\Entity\Evaluation $evaluations
     * @return Lesson
     */
    public function addEvaluation(\LessonBundle\Entity\Evaluation $evaluations)
    {
        $this->evaluations[] = $evaluations;
    
        $evaluations->setLesson($this);
    
    
        return $this;
    }
    

    0 讨论(0)
提交回复
热议问题