GeoDealerForm   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 25 1
A getName() 0 4 1
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