Skip to content

Instantly share code, notes, and snippets.

@albertvolkman
Created January 15, 2015 01:43
Show Gist options
  • Save albertvolkman/97447694bfa571183b31 to your computer and use it in GitHub Desktop.
Save albertvolkman/97447694bfa571183b31 to your computer and use it in GitHub Desktop.
AppBundle\Entity\Recipe:
type: entity
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
name:
type: string
length: 100
oneToMany:
recipe_ingredient:
targetEntity: RecipeIngredient
mappedBy: recipe
AppBundle\Entity\Ingredient:
type: entity
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
name:
type: string
length: 100
unit:
type: string
length: 50
oneToMany:
ingredient:
targetEntity: RecipeIngredient
mappedBy: ingredient
AppBundle\Entity\RecipeIngredient:
type: entity
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
recipe_id:
type: integer
ingredient_id:
type: integer
amount:
type: string
length: 50
manyToOne:
recipe:
targetEntity: Recipe
joinColumn:
name: recipe_id
referencedColumnName: id
ingredient:
targetEntity: Ingredient
joinColumn:
name: ingredient_id
referencedColumnName: id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment