2016-06-09 51 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

因爲你有一個字符串的「類型」 ...... –