Skip to content

Instantly share code, notes, and snippets.

@pjedrzejewski
Created February 26, 2011 11:41
Show Gist options
  • Save pjedrzejewski/845136 to your computer and use it in GitHub Desktop.
Save pjedrzejewski/845136 to your computer and use it in GitHub Desktop.
/**
* Products.
*
* @OneToMany(targetEntity="Sylius\AssortmentBundle\Entity\Product", mappedBy="category")
*/
protected $products;
/* ... */
public function __construct()
{
$this->products = new ArrayCollection();
/* ... */
/**
* Category.
*
* @orm:ManyToOne(targetEntity="Sylius\AssortmentBundle\Entity\Category")
* @orm:JoinColumn(name="category_id", referencedColumnName="id")
*/
protected $category = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment