0

我正在尝试从我的文件实体加载一个对象,但 symfony 不断返回“Class Frontend\FolderBundle\Entity\Role 不存在”,但我可以从子文件夹实体中使用它而不会出现任何问题或警告

我有以下实体:

Frontend\FolderBundle\Entity\File:
type: entity
table: file
fields:
id:
  type: integer
  id: true
  generator:
    strategy: AUTO
filename:
  type: text
user:
  type: integer
manyToOne:
folder:
    targetEntity: Frontend\FolderBundle\Entity\Subfolder
    inversedBy: files
    joinColumn:
      name: subfolder_id
      referencedColumnName: id
lifecycleCallbacks: {  }


Frontend\FolderBundle\Entity\Subfolder:
type: entity
table: subfolder
fields:
id:
  type: integer
  id: true
  generator:
    strategy: AUTO
name:
  type: string
  length: 255
manyToOne:
    folder:
        targetEntity: Folder
        inversedBy: subfolder
        joinColumn:
            name: folder_id
            referencedColumnName: id
oneToMany:
    files:
        targetEntity: File
        mappedBy: folder
manyToMany:
roles:
  targetEntity: Frontend\UserBundle\Entity\Role
  inversedBy: subfolders
  joinTable:
    name: folder_rights
    joinColumns:
      subfolder_id:
        referencedColumnName: id
    inverseJoinColumns:
      role_id:
        referencedColumnName: id
lifecycleCallbacks: {  }

从子文件夹中获取角色的文件夹工作正常。

我已经清除了应用程序/缓存和教义缓存,但这并不能解决问题..

如果您需要更多信息/代码片段,请询问,我会提供。

提前致谢,

4

1 回答 1

0

错误出现在 Subfolder.php 实体中。有一个 addRole 函数引用了具有正确实体的错误包。

于 2012-05-10T07:14:18.063 回答