Sonata Admin Bundle One-to-Many relationship not saving foreign ID

前端 未结 6 1325
粉色の甜心
粉色の甜心 2020-12-14 12:23

I have a problem with the SonataAdminBunle in combination with symfony 2.2. I have a Project entity and a ProjectImage entity and specified a One-to-Many relationship betwee

6条回答
  •  情歌与酒
    2020-12-14 13:01

    public function prePersist($user)
    {
        $this->preUpdate($user);
    }
    
    public function preUpdate($user)
    {
        $user->setProperties($user->getProperties());
    }
    

    This has perfectly solved the problem for me thanks !

提交回复
热议问题