2016-06-09 55 views
1

我刚刚创建了一个Bundle FIRM/ComCollectBundle(名称为FirmComCollectBundle)。然后,我创建了一个文件的src /事务所/ ComCollectBundle /资源/配置/教义/ ForumUser.orm.yml与此内容:Symfony3中的学说无效映射文件

FIRMComCollectBundle\Entity\ForumUser: 
    type: entity 
    table: forum_users 
    repositoryClass: FIRM\ComCollectBundle\Entity\ForumUserRepository 
    id: 
    id: 
     type: integer 
     generator: { strategy: AUTO } 
    fields: 
    name: 
     type: string 
     length: 30 

当我现在尝试使用控制台创建实体

$ php bin/console doctrine:generate:entities FIRM\CommCollectBundle\ForumUser 

我得到这个错误:

[Doctrine\Common\Persistence\Mapping\MappingException]      
    Invalid mapping file 'FIRM.ComCollectBundle.Entity.ForumUser.orm.yml' for cl 
    ass 'FIRM\ComCollectBundle\Entity\ForumUser'.  

同样的错误(约ForumUser),甚至当我尝试生成另一个bundle实体出现(的appbundle)!

回答

1

看来,该length: 30是问题,那必须是length: '30'

+0

因为你有一个字符串的“类型” ...... –