无法在 mautic
中的控制器中访问新模型Mautic使用 Symfony 2.x 框架
已采取的步骤:
在配置中注册的服务
'repositories' => [
'mautic.campaignrequest.repository.campaignrequest' => [
'class' => Doctrine\ORM\EntityRepository::class,
'factory' => ['@doctrine.orm.entity_manager', 'getRepository'],
'arguments' => [
\Mautic\CampaignRequestBundle\Entity\CampaignRequest::class,
],
'models' => [
'mautic.campaignrequest.model.campaignrequest' => [
'class' => \Mautic\CampaignRequestBundle\Model\CampaignRequestModel::class,
'arguments' => [],
],
但是,当尝试在控制器中访问模型时,会引发错误,表明模型未在容器中注册。 我想念什么吗?,有人可以帮我吗。
错误提示:
[2019-12-23 13:23:47] mautic.CRITICAL:未捕获的PHP异常 InvalidArgumentException: “ mautic.campaignrequest.model.campaignrequest未注册 容器密钥。” /projects/mautic/2.15.2/mautic/app/bundles/ApiBundle/Controller/CommonApiController.php第923行{“ exception”:“ [object](InvalidArgumentException(code:0): mautic.campaignrequest.model.campaignrequest未注册 容器密钥。在 /projects/mautic/2.15.2/mautic/app/bundles/ApiBundle/Controller/CommonApiController.php:923)“} []