Tabla Articulos
Código PHP:
/*
* @var ArrayCollection $categories
* @ORM\ManyToMany(targetEntity="Micra\BackendBundle\Entity\Seo",inversedBy="articles")
* @ORM\JoinTable(name="articles_seos",
* joinColumns={@ORM\JoinColumn(name="articles_id", referencedColumnName="id", onDelete="cascade")},
* inverseJoinColumns={@ORM\JoinColumn(name="seo_id", referencedColumnName="id", onDelete="cascade")})
*
*/
protected $seo;
/*
* @var ArrayCollection $categories
* @ORM\ManyToMany(targetEntity="Micra\BackendBundle\Entity\Categories", inversedBy="articles")
@ORM\JoinTable(name="articles_categories",
* joinColumns={@ORM\JoinColumn(name="articles_id", referencedColumnName="id", onDelete="cascade"))},
* inverseJoinColumns={@ORM\JoinColumn(name="categories_id", referencedColumnName="id", onDelete="cascade"))})
Código PHP:
/**
@var ArrayCollection $articles
* @ORM\ManyToMany(targetEntity="Micra\BackendBundle\Entity\Articles", mappedBy="categories")
*/
protected $articles;
Código PHP:
/**
* @var ArrayCollection $articles
* @ORM\ManyToMany(targetEntity="\Micra\BackendBundle\Entity\Articles", mappedBy="seo")
*
*/
protected $articles;