Skip to content

Instantly share code, notes, and snippets.

View fatorx's full-sized avatar
💭
Learning and learning.

Fabio de Souza fatorx

💭
Learning and learning.
View GitHub Profile
@fatorx
fatorx / gist:8099313
Created December 23, 2013 15:48
ZF2 - Pegar um campo de um elemento Collection na view
<?php
$formCampos = $form->get('fieldset_princpal');
$collectionElement = $formCampos->get('collection_element');
?>
<?php $campoTipo = $collectionElement->getFieldsets()[0]->getElements()['nomeCampo']; ?>
@fatorx
fatorx / gist:7870874
Last active December 30, 2015 18:59
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;
<?php
namespace Imoveis\Entity;
use Doctrine\ORM\Mapping as ORM;
use Zend\Stdlib\Hydrator;
/**
* Bairros
*