Month: fevereiro 2015

Mapeamento muitos pra muitos no Doctrine

Mapeamento muitos pra muitos no Doctrine

Class product { /** * @var Species[] * @ORM\ManyToMany (targetEntity=”Species”) * @ORM\JoinTable (name=”product_species”, * joinColumns={@ORM\JoinColumn(name=”productId”, referencedColumnName=”id”)}, * inverseJoinColumns={@ORM\JoinColumn(name=”speciesId”, referencedColumnName=”id”)} * ) * @ORM\OrderBy({“name” = “asc”}) */ private $species; Mais detalhes em : http://stackoverflow.com/questions/12478583/how-to-orderby-on-onetomany-manytoone