简体   繁体   English

在链配置的名称空间中找不到类“ Sonata \\ PageBundle \\ Model \\ Site”

[英]The class 'Sonata\PageBundle\Model\Site' was not found in the chain configured namespaces

I am working on a Symfony 3.3 application that uses Sonata's page bundle. 我正在使用Sonata页面捆绑的Symfony 3.3应用程序上工作。

I want to create a Page fixture that is assigned to a Site. 我想创建分配给站点的Page装置。 To get the repository of available sites, I have attempted to use this line of code: 为了获得可用站点的存储库,我尝试使用以下代码行:

$siteRepository = $manager->getRepository('Sonata\PageBundle\Model\Site');

... But I get the following error: ...但是出现以下错误:

The class 'Sonata\\PageBundle\\Model\\Site' was not found in the chain configured namespaces Application\\Sonata\\Clas 在链配置的名称空间Application \\ Sonata \\ Clas中找不到类'Sonata \\ PageBundle \\ Model \\ Site'
sificationBundle\\Entity, Sonata\\ClassificationBundle\\Entity, Application\\Sonata\\MediaBundle\\Entity, Sonata\\MediaB undle\\Entity, Sonata\\NotificationBundle\\Entity, Application\\Sonata\\NotificationBundle\\Entity, Application\\Sonata\\ sificationBundle \\ Entity,Sonata \\ ClassificationBundle \\ Entity,Application \\ Sonata \\ MediaBundle \\ Entity,Sonata \\ MediaB undle \\ Entity,Sonata \\ NotificationBundle \\ Entity,Application \\ Sonata \\ NotificationBundle \\ Entity,Application \\ Sonata \\
PageBundle\\Entity, Sonata\\PageBundle\\Entity, Sonata\\UserBundle\\Entity, Spy\\TimelineBundle\\Entity, Application\\Son PageBundle \\ Entity,Sonata \\ PageBundle \\ Entity,Sonata \\ UserBundle \\ Entity,Spy \\ TimelineBundle \\ Entity,Application \\ Son
ata\\TimelineBundle\\Entity, Application\\Sonata\\UserBundle\\Entity, Sonata\\TimelineBundle\\Entity, AppBundle\\Entity ata \\ TimelineBundle \\ Entity,Application \\ Sonata \\ UserBundle \\ Entity,Sonata \\ TimelineBundle \\ Entity,AppBundle \\ Entity

What am I doing wrong here? 我在这里做错了什么?

It turned out that this class was already being extended locally, so I was able to get something that worked by using: 原来,该类已经在本地扩展,因此我可以通过使用以下方法获得一些有用的东西:

$siteRepository = $manager->getRepository('ApplicationSonataPageBundle:Site');

That doesn't really answer my original question, but maybe it will help somebody. 那并不能真正回答我最初的问题,但是也许可以帮助到别人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在链配置的命名空间中找不到类“App\\Entity\\Users” - The class 'App\Entity\Users' was not found in the chain configured namespaces 在链配置的名称空间中找不到类'DoctrineModule \\ Stdlib \\ Hydrator \\ DoctrineObject' - The class 'DoctrineModule\Stdlib\Hydrator\DoctrineObject' was not found in the chain configured namespaces Symfony + Doctrine ODM“在链配置的名称空间CoreBundle / Document中找不到该类” - Symfony + Doctrine ODM “The class was not found in the chain configured namespaces CoreBundle/Document” 在链配置的名称空间\\ Document中找不到类'Calendar \\ Document \\ Calendar'? - class 'Calendar\Document\Calendar' was not found in the chain configured namespaces \Document? 在链配置的命名空间 XXX 中找不到类“Doctrine\\ORM\\EntityManager” - The class 'Doctrine\ORM\EntityManager' was not found in the chain configured namespaces XXX 在链配置的名称空间中找不到类“ App \\ Document \\ User” - The class 'App\Document\User' was not found in the chain configured namespaces Symfony2 - 在链配置的命名空间中找不到类“X” - Symfony2 - The class 'X' was not found in the chain configured namespaces 在链配置的命名空间 StudentsBundle\\Entity 中找不到类“ScheduleBundle\\Entity\\schedule” - The class 'ScheduleBundle\Entity\schedule' was not found in the chain configured namespaces StudentsBundle\Entity Symfony 错误在链配置的命名空间 XXX 中找不到类 XXX - Symfony error The class XXX was not found in the chain configured namespaces XXX 服务中的“未在已配置链的命名空间中找到X” - 'X was not found in the chain configured namespaces' in service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM