Fix ORM Designer yml files for symfony2
This bundle for fix ORM Designer generated YML metadata files., (*1)
Add bundle in AppKernel:, (*2)
if (in_array($this->getEnvironment(), array('dev', 'test'))) { ... $bundles[] = new Limitium\ORMDFixer\ORMDFixerBundle(); }, (*3)
Call app/console yaml:fix Acme
, (*4)
Example of input dcm and output orm files:, (*5)
src\PDS\StoryBundle\Resources\config\doctrine\Comment.dcm.yml
, (*6)
Comment: type: entity table: comment fields: id: id: true type: integer generator: strategy: AUTO message: type: text nullable: false created_at: type: datetime nullable: false manyToOne: Story: targetEntity: Story inversedBy: Comments joinColumns: story_id: referencedColumnName: id User: targetEntity: User inversedBy: Comments joinColumns: user_id: referencedColumnName: id
src\PDS\StoryBundle\Resources\config\doctrine\Comment.orm.yml
, (*7)
PDS\StoryBundle\Entity\Comment: type: entity table: comment fields: id: id: true type: integer generator: strategy: AUTO message: type: text nullable: false created_at: type: datetime nullable: false manyToOne: Story: targetEntity: PDS\StoryBundle\Entity\Story inversedBy: Comments joinColumns: story_id: referencedColumnName: id User: targetEntity: PDS\UserBundle\Entity\User inversedBy: Comments joinColumns: user_id: referencedColumnName: id