【问题标题】:Error while installing CCDNForumBundle User entity was not found in the chain configured namespaces安装 CCDNSForumBundle 时出错 在链配置的命名空间中找不到用户实体
【发布时间】:2014-10-24 12:29:02
【问题描述】:

我想说我可能已经找到了解决方案,太糟糕了,它是法语的。以下是解决方案的链接。

http://fr.openclassrooms.com/forum/sujet/mappingexception

出现以下错误:

[Doctrine\Common\Persistence\Mapping\MappingException]
在链中找不到类 'HUPR\UserBundle\Entity\User' 配置的命名空间 CCDNSForum\ForumBundle\Entity, FOS\UserBundle\模型

我有这个捆绑包:

namespace HUPR\UserBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

    class HUPRUserBundle extends Bundle
    {
        public function getParent() {
            return 'FOSUserBundle';
        }
    }

这是我的app/config/config.yml

学说配置

orm:
  default_entity_manager: default
  auto_generate_proxy_classes: "%kernel.debug%"
      resolve_target_entities:
          Symfony\Component\Security\Core\User\UserInterface: HUPR\UserBundle\Entity\User
      entity_managers:
          default:
              mappings:
                  CCDNForumForumBundle:
                      mapping:              true
                      type:                 yml
                      dir:                  "Resources/config/doctrine"
                      alias:                ~
                      prefix:               CCDNForum\ForumBundle\Entity
                      is_bundle:            true

【问题讨论】:

  • 还在纠结这个,有没有人能帮帮我?

标签: symfony mapping bundle fosuserbundle forum


【解决方案1】:

找到了解决方案,需要映射我的包:

mappings: 
FOSUserBundle: ~
HUPRUserBundle:
    mapping:              true
    type:                 annotation
    #dir:                  "Resources/config/doctrine"
    alias:                ~
    prefix:               HUPR\UserBundle\Entity
    is_bundle:            true
CCDNForumForumBundle:
    mapping:              true
    type:                 yml
    dir:                  "Resources/config/doctrine"
    alias:                ~
    prefix:               CCDNForum\ForumBundle\Entity
    is_bundle:            true

【讨论】:

  • 非常感谢我刚刚遇到这个问题。不幸的是,文档不好
  • 我很高兴能派上用场!我在设置它时遇到了麻烦。
猜你喜欢
  • 1970-01-01
  • 2023-03-02
  • 2015-11-12
  • 1970-01-01
  • 2019-08-17
  • 2019-08-10
  • 2014-12-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多