AddUrlForm   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A buildForm() 0 53 1
1
<?php
2
/*************************************************************************************/
3
/*      This file is part of the RewriteUrl module for Thelia.                       */
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
namespace RewriteUrl\Form;
14
15
use Symfony\Component\Validator\Constraints\NotBlank;
16
use Thelia\Form\BaseForm;
17
18
/**
19
 * Class AddUrlForm
20
 * @package RewriteUrl\Form
21
 * @author Vincent Lopes <[email protected]>
22
 */
23
class AddUrlForm extends BaseForm
24
{
25
    /**
26
     * @return string
27
     */
28
    public function getName()
29
    {
30
        return "rewriteurl_add_form";
31
    }
32
33
    public function buildForm()
34
    {
35
        $this->formBuilder
36
            ->add(
37
                'view',
38
                'text',
39
                array(
40
                    'constraints'   => array(new NotBlank()),
41
                    'required'      => true
42
                )
43
            )
44
            ->add(
45
                'view-id',
46
                'text',
47
                array(
48
                    'constraints'   => array(new NotBlank()),
49
                    'required'      => true
50
                )
51
            )
52
            ->add(
53
                'url',
54
                'text',
55
                array(
56
                    'constraints'  => array(new NotBlank()),
57
                    'required'     => true
58
                )
59
            )
60
            ->add(
61
                'default',
62
                'text',
63
                array(
64
                    'constraints'  => array(new NotBlank()),
65
                    'required'     => true
66
                )
67
            )
68
            ->add(
69
                'locale',
70
                'text',
71
                array(
72
                    'constraints'  => array(new NotBlank()),
73
                    'required'     => true
74
                )
75
            )
76
            ->add(
77
                'httpcode',
78
                'text',
79
                array(
80
                    'constraints'  => array(new NotBlank()),
81
                    'required'     => true
82
                )
83
            )
84
        ;
85
    }
86
}
87