Skip to content

Instantly share code, notes, and snippets.

@hhamon
Created February 20, 2011 12:01
Show Gist options
  • Select an option

  • Save hhamon/835929 to your computer and use it in GitHub Desktop.

Select an option

Save hhamon/835929 to your computer and use it in GitHub Desktop.
<?php
namespace Sensio\Bundle\JobeetBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
* The Affiliate entity class.
*
* @orm:Entity
* @orm:Table(name="jobeet_affiliate")
*/
class Affiliate
{
/**
* The associated categories.
*
* @var Doctrine\Common\Collections\ArrayCollection;
*
* @orm:ManyToMany(targetEntity="Category", inversedBy="affiliates")
* @orm:JoinTable(
* joinColumns={@orm:JoinColumn(name="affiliate_id", referencedColumnName="id")},
* inverseJoinColumns={@orm:JoinColumn(name="category_id", referencedColumnName="id")}
* )
*/
private $categories;
// ...
}
class Category
{
/**
* The associated affiliates.
*
* @var Doctrine\Common\Collections\ArrayCollection;
*
* @orm:ManyToMany(targetEntity="Affiliate", inversedBy="categories")
*/
private $affiliates;
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment