|
1
|
|
|
<?php |
|
2
|
|
|
/*************************************************************************************/ |
|
3
|
|
|
/* This file is part of the Thelia package. */ |
|
4
|
|
|
/* */ |
|
5
|
|
|
/* Copyright (c) OpenStudio */ |
|
6
|
|
|
/* email : [email protected] */ |
|
7
|
|
|
/* web : http://www.thelia.net */ |
|
8
|
|
|
/* */ |
|
9
|
|
|
/* For the full copyright and license information, please view the LICENSE.txt */ |
|
10
|
|
|
/* file that was distributed with this source code. */ |
|
11
|
|
|
/*************************************************************************************/ |
|
12
|
|
|
/*************************************************************************************/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Dealer\Form; |
|
15
|
|
|
|
|
16
|
|
|
use Dealer\Dealer; |
|
17
|
|
|
use Symfony\Component\Validator\Constraints\NotBlank; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Class ContactInfoUpdateForm |
|
21
|
|
|
* @package Dealer\Form |
|
22
|
|
|
*/ |
|
23
|
|
|
class ContactInfoUpdateForm extends ContactInfoForm |
|
24
|
|
|
{ |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* |
|
28
|
|
|
* in this function you add all the fields you need for your Form. |
|
29
|
|
|
* Form this you have to call add method on $this->formBuilder attribute : |
|
30
|
|
|
* |
|
31
|
|
|
* $this->formBuilder->add("name", "text") |
|
32
|
|
|
* ->add("email", "email", array( |
|
33
|
|
|
* "attr" => array( |
|
34
|
|
|
* "class" => "field" |
|
35
|
|
|
* ), |
|
36
|
|
|
* "label" => "email", |
|
37
|
|
|
* "constraints" => array( |
|
38
|
|
|
* new \Symfony\Component\Validator\Constraints\NotBlank() |
|
39
|
|
|
* ) |
|
40
|
|
|
* ) |
|
41
|
|
|
* ) |
|
42
|
|
|
* ->add('age', 'integer'); |
|
43
|
|
|
* |
|
44
|
|
|
* @return null |
|
45
|
|
|
*/ |
|
46
|
|
|
protected function buildForm() |
|
47
|
|
|
{ |
|
48
|
|
|
parent::buildForm(); |
|
49
|
|
|
|
|
50
|
|
|
$this->formBuilder |
|
51
|
|
|
->add('id', 'integer', array( |
|
52
|
|
|
"label" => $this->translator->trans("Id", [], Dealer::MESSAGE_DOMAIN), |
|
53
|
|
|
"label_attr" => ["for" => "attr-dealer-contact-info-id"], |
|
54
|
|
|
"required" => true, |
|
55
|
|
|
"constraints" => array(new NotBlank(), ), |
|
56
|
|
|
"attr" => array() |
|
57
|
|
|
)) |
|
58
|
|
|
; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function getName() |
|
62
|
|
|
{ |
|
63
|
|
|
return "contact_info_update"; |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|