0
我在symfony或doctrine中遇到问题。 我有一个实体notificationsettinggroupdetail
和notificationsettinggroup
。学说(Symfony3)可捕捉的致命错误:传递给(bundle)的参数1必须是(bundle)的一个实例,数组给出
Notificationsettinggroup
and notificationsettinggroup
是主要细节,并在实体原则中具有连接条件。
的问题都交给我时,我想用删除从主(notificationsetinggroup
)数据细节:
/**
* Remove notificationSettingGroupDetail
*
* @param \Dsp\DspAdministrationBundle\Entity\notificationSettingGroupDetail $notificationSettingGroupDetail
*/
public function removeNotificationSettingGroupDetail(notificationSettingGroupDetail $notificationSettingGroupDetail)
{
$this->NotificationSettingGroupDetail->removeElement($notificationSettingGroupDetail);
}
,但是当我用这个,我得到了一些错误:
Catchable Fatal Error: Argument 1 passed to Dsp\DspAdministrationBundle\Entity\notificationSettingGroup::removeNotificationSettingGroupDetail() must be an instance of Dsp\DspAdministrationBundle\Entity\notificationSettingGroupDetail, array given, called in C:\xampp\htdocs\Symfony-DspWebApp\src\Dsp\DspAdministrationBundle\Controller\Api\ApiNotificationSettingGroupController.php on line 122 and defined
这是代码在控制器中:
$entityDetailDelete = $this->getDoctrine()->getRepository(notificationSettingGroupDetail::class)->findNotificationGroupSettingDetailByMaster($userOld[$i]['id']);
$entity->removeNotificationSettingGroupDetail($entityDetailDelete);
哪里是我的错?