Completed
Push — develop ( 168e99...0122be )
by
unknown
18:37 queued 07:11
created

InvoiceAddressFieldset   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 102
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B init() 0 88 1
A getHydrator() 0 8 2
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license    MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
10
/** */
11
namespace Orders\Form;
12
13
use Core\Entity\Hydrator\EntityHydrator;
14
use Zend\Form\Fieldset;
15
16
/**
17
 * ${CARET}
18
 *
19
 * @author Mathias Gelhausen <[email protected]>
20
 * @todo   write test
21
 */
22
class InvoiceAddressFieldset extends Fieldset
23
{
24
25
    public function init()
26
    {
27
        $this->setName('invoiceAddress');
28
29
        $this->add([
30
            'type'    => 'text',
31
            'name'    => 'title',
32
            'options' => [
33
                'label' => 'Title',
34
                'description' => /*@translate*/ 'Enter the form of address you would appreciate',
35
            ],
36
        ]);
37
38
        $this->add([
39
            'type'    => 'text',
40
            'name'    => 'name',
41
            'options' => [
42
                'label' => /*@translate*/ 'Full name',
43
                'description' => /*@translate*/ 'Enter your full name (First, middle and last name)',
44
            ],
45
        ]);
46
47
        $this->add([
48
            'type'    => 'text',
49
            'name'    => 'company',
50
            'options' => [
51
                'label' => /*@translate*/ 'Company',
52
                'description' => /*@translate*/ 'Enter the name of the company',
53
            ],
54
        ]);
55
56
        $this->add([
57
            'type'    => 'text',
58
            'name'    => 'street',
59
            'options' => [
60
                'label' => /*@translate*/ 'Street',
61
            ],
62
        ]);
63
64
        $this->add([
65
                       'type'    => 'text',
66
                       'name'    => 'zipCode',
67
                       'options' => [
68
                           'label' => 'Postal code'
69
                       ],
70
                   ]);
71
72
        $this->add([
73
                       'type'    => 'text',
74
                       'name'    => 'city',
75
                       'options' => [
76
                           'label' => /*@translate*/ 'City',
77
                       ],
78
                   ]);
79
80
        $this->add([
81
                       'type'    => 'text',
82
                       'name'    => 'region',
83
                       'options' => [
84
                           'label' => /*@translate*/ 'Region',
85
                       ],
86
                   ]);
87
88
        $this->add([
89
                       'type'    => 'text',
90
                       'name'    => 'country',
91
                       'options' => [
92
                           'label' => /*@translate*/ 'Country',
93
                       ],
94
                   ]);
95
96
        $this->add([
97
                       'type'    => 'text',
98
                       'name'    => 'vatId',
99
                       'options' => [
100
                           'label' => /*@translate*/ 'Value added tax ID',
101
                       ],
102
                   ]);
103
        $this->add([
104
                       'type'    => 'text',
105
                       'name'    => 'email',
106
                       'options' => [
107
                           'label' => /*@translate*/ 'Email address',
108
                       ],
109
                   ]);
110
111
112
    }
113
114
    public function getHydrator()
115
    {
116
        if (!$this->hydrator) {
117
            $this->setHydrator(new EntityHydrator());
118
        }
119
120
        return parent::getHydrator();
121
    }
122
123
}