1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| protected $_typeCoordonnee,$_typeTelephone,$_departement,$_pays,$_typePersonnelSante,$_sexe;
public function __construct($typeCoordonnee,$typeTelephone,$pays,$departement,$type,$sexe)
{
$this->_typeCoordonnee = $typeCoordonnee;
$this->_typeTelephone = $typeTelephone;
$this->_departement = $departement;
$this->_pays = $pays;
$this->_type = $type;
$this->_sexe = $sexe;
}
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add("type",'entity',array(
'class' => 'IML\IceBundle\Entity\Code\Type',
'property' => 'libelle',
'required' => false,
'label' => 'Type',
'error_bubbling' => true,
'empty_value' => false,
'choices' => $this->_type
));
$builder->add('nom', 'text', array('required' => false,'error_bubbling'=>true));
$builder->add('prenom', null, array('required' => false,'label'=>'Prénom','error_bubbling'=>true));
$builder->add('sexe', 'entity', array(
'class' => 'IML\DefaultBundle\Entity\Code\Sexe',
'property' => 'libelle',
'expanded' => false,
'multiple' => false,
'required' => false,
'error_bubbling' => true,
'empty_value' => false,
'choices' => $this->_sexe
));
$builder->add('telephones', 'collection', array(
'type' => new TelephonesForm( $this->_typeCoordonnee,$this->_typeTelephone),
'error_bubbling' => true,
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
));
$builder->add('adresse', 'collection', array(
'type' => new AdressesForm( $this->_pays,$this->_departement,$this->_typeCoordonnee),
'prototype' => true,
'error_bubbling' => true,
'allow_add' => true,
'allow_delete' => true,
));
$builder->add('email', 'collection', array(
'type' => new EmailsForm($this->_typeCoordonnee),
'prototype' => true,
'error_bubbling' => true,
'allow_add' => true,
'allow_delete' => true
)); |
Partager