https://github.com/limitium/ormd-fixer
Fix old ORM Disigner files
https://github.com/limitium/ormd-fixer
Last synced: 6 months ago
JSON representation
Fix old ORM Disigner files
- Host: GitHub
- URL: https://github.com/limitium/ormd-fixer
- Owner: limitium
- Created: 2011-12-22T12:02:11.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2015-03-15T13:07:05.000Z (over 11 years ago)
- Last Synced: 2025-01-23T04:43:52.660Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 137 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ORM Designer Fixer
===
This bundle for fix ORM Designer generated YML metadata files.
Add bundle in AppKernel:
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
...
$bundles[] = new Limitium\ORMDFixer\ORMDFixerBundle();
}
Call `app/console yaml:fix Acme`
- 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:
``src\PDS\StoryBundle\Resources\config\doctrine\Comment.dcm.yml``
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``
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