Asara
Asara

Reputation: 3374

Doctrine in Symfony3 invalid mapping file

I just createt a Bundle FIRM/ComCollectBundle (with the name FirmComCollectBundle). Then I created a File src/FIRM/ComCollectBundle/Resources/config/doctrine/ForumUser.orm.yml with this content:

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

when I now try to use the console to create entities

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

I get this error:

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

The same error (about ForumUser) even appears when I try to generate entities for another bundle (AppBundle)!

Upvotes: 1

Views: 1357

Answers (1)

Asara
Asara

Reputation: 3374

It seems, that the length: 30 was the problem, that has to be length: '30'

Upvotes: 1

Related Questions