Skip to content

Instantly share code, notes, and snippets.

@fatorx
Last active December 30, 2015 18:59
Show Gist options
  • Save fatorx/7870874 to your computer and use it in GitHub Desktop.
Save fatorx/7870874 to your computer and use it in GitHub Desktop.
Doctrine - entidades relacionadas
- Entidades Relacionadas
Inserir a anotação | fetch="EAGER" | no item de relacionamento,
para carregar automaticamente o objeto.
Ex:
/**
* @ORM\OneToMany(targetEntity="Clientes\Entity\PedidosItens", mappedBy="pedido", fetch="EAGER")
*/
private $itens;
Sem essa anotattion, se acessado $entity->getItens(), é retorno null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment