2017 © Pedro Peláez
 

symfony-bundle ormd-fixer

Fix ORM Designer yml files for symfony2

image

limitium/ormd-fixer

Fix ORM Designer yml files for symfony2

  • Sunday, March 15, 2015
  • by limitium
  • Repository
  • 1 Watchers
  • 1 Stars
  • 310 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ORM Designer Fixer

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)

  • Create Modelname.orm.yml file from ModelName.dcm.yml
  • Fix all references in Modelname.orm.yml
  • Delete ModelName.dcm.yml file

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

The Versions

15/03 2015

dev-master

9999999-dev

Fix ORM Designer yml files for symfony2

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar limitium

orm symfony yaml designer