Last active
December 30, 2015 18:59
-
-
Save fatorx/7870874 to your computer and use it in GitHub Desktop.
Doctrine - entidades relacionadas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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