Completed
Push — develop ( 9e3d33...36b339 )
by
unknown
08:18
created

InvoiceAddressSettingsFieldset::init()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 28
rs 8.8571
cc 1
eloc 17
nc 1
nop 0
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 Settings\Form\SettingsFieldset;
14
15
/**
16
 * ${CARET}
17
 * 
18
 * @author Mathias Gelhausen <[email protected]>
19
 * @todo write test 
20
 */
21
class InvoiceAddressSettingsFieldset extends SettingsFieldset
22
{
23
    /*
24
     * map label of fieldset. You can set the order by using an array [<label>,<priority>]
25
     */
26
    protected $labelMap = [
27
        'name'  => [/*@translate*/ 'Full Name', -20],
28
        'company' => /*@translate*/ 'Company',
29
        'street' => /*@translate*/ 'Street',
30
        'zipCode' => /*@translate*/ 'Postalcode',
31
        'city' => /*@translate*/ 'City',
32
        'region' => /*@translate*/ 'Region',
33
        'country' => /*@translate*/ 'Country',
34
        'vatId' => /*@translate*/ 'Value added tax ID',
35
        'email' =>  [/*@translate*/ 'Email address', -30]
36
    ];
37
38
    public function init()
39
    {
40
        $this->setLabel(/*@translate*/ 'Invoice Address');
41
42
        $this->add(
43
            [
44
                'name'       => 'gender',
45
                'type'       => 'Zend\Form\Element\Select',
46
                'options'    => [
47
                    'label'         => /*@translate */ 'Salutation',
48
                    'value_options' => [
49
                        ''       => '',
50
                        'male'   => /*@translate */ 'Mr.',
51
                        'female' => /*@translate */ 'Mrs.',
52
                    ]
53
                ],
54
                'attributes' => [
55
                    'data-placeholder' => /*@translate*/ 'please select',
56
                    'data-allowclear' => 'false',
57
                    'data-searchbox' => -1,  // hide the search box
58
                    'required' => true, // mark label as required
59
                ],
60
            ],
61
            ['priority'=>-10]
62
        );
63
64
65
    }
66
67
    
68
}