Skip to content

Instantly share code, notes, and snippets.

@pjedrzejewski
Created September 25, 2011 19:00
Show Gist options
  • Save pjedrzejewski/1240967 to your computer and use it in GitHub Desktop.
Save pjedrzejewski/1240967 to your computer and use it in GitHub Desktop.
Easy categorizing with Symfony2, gist #5.
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Application\Bundle\AssortmentBundle\Entity\Product" table="sylius_assortment_product">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<many-to-one field="category" target-entity="Application\Bundle\AssortmentBundle\Entity\Category">
<join-column name="category_id" referenced-column-name="id" />
</many-to-one>
</entity>
</doctrine-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment