|
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
|
|
|
use Thelia\Form\BaseForm; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* Class GeoDealerForm |
|
22
|
|
|
* @package Dealer\Form |
|
23
|
|
|
*/ |
|
24
|
|
|
class GeoDealerForm extends BaseForm |
|
25
|
|
|
{ |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @inheritDoc |
|
29
|
|
|
*/ |
|
30
|
|
|
protected function buildForm() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->formBuilder |
|
33
|
|
|
->add('id', 'integer', array( |
|
34
|
|
|
"label" => $this->translator->trans("Id", [], Dealer::MESSAGE_DOMAIN), |
|
35
|
|
|
"label_attr" => ["for" => "dealer.geo.id"], |
|
36
|
|
|
"required" => true, |
|
37
|
|
|
"constraints" => array(new NotBlank(), ), |
|
38
|
|
|
"attr" => array() |
|
39
|
|
|
)) |
|
40
|
|
|
->add("latitude", "number", array( |
|
41
|
|
|
"label" => $this->translator->trans("Latitude", [], Dealer::MESSAGE_DOMAIN), |
|
42
|
|
|
"label_attr" => ["for" => "attr-dealer-geo-lat"], |
|
43
|
|
|
"required" => false, |
|
44
|
|
|
"constraints" => array(), |
|
45
|
|
|
"attr" => array("step" => "0.01", ) |
|
46
|
|
|
)) |
|
47
|
|
|
->add("longitude", "number", array( |
|
48
|
|
|
"label" => $this->translator->trans("Longitude", [], Dealer::MESSAGE_DOMAIN), |
|
49
|
|
|
"label_attr" => ["for" => "attr-dealer-geo-lon"], |
|
50
|
|
|
"required" => false, |
|
51
|
|
|
"constraints" => array(), |
|
52
|
|
|
"attr" => array("step" => "0.01", ) |
|
53
|
|
|
)); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
public function getName() |
|
58
|
|
|
{ |
|
59
|
|
|
return "dealer_geo"; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|