Passed
Push — master ( 700b0f...aafb0a )
by Björn
18:25 queued 10s
created

AclmatrixForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 75
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 72 1
1
<?php
2
/**
3
 * BB's Zend Framework 2 Components
4
 * 
5
 * AdminModule
6
 *
7
 * @package   [MyApplication]
8
 * @package   BB's Zend Framework 2 Components
9
 * @package   AdminModule
10
 * @author    Björn Bartels <[email protected]>
11
 * @link      https://gitlab.bjoernbartels.earth/groups/zf2
12
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
13
 * @copyright copyright (c) 2016 Björn Bartels <[email protected]>
14
 */
15
16
namespace Admin\Form;
17
18
use Zend\Form\Form;
19
20
class AclmatrixForm extends Form
21
{
22
    public function __construct($name = null)
23
    {
24
        // we want to ignore the name passed
25
        parent::__construct('acl');
26
        $this->setAttribute('method', 'post');
27
        
28
        $this->add(
29
            array(
30
            'name' => 'acl_id',
31
            'attributes' => array(
32
            'type'  => 'hidden',
33
            ),
34
            )
35
        );
36
        $this->add(
37
            array(
38
            'name' => 'aclroles_id',
39
            'attributes' => array(
40
            'type'  => 'hidden',
41
            ),
42
            )
43
        );
44
        $this->add(
45
            array(
46
            'name' => 'aclresources_id',
47
            'attributes' => array(
48
            'type'  => 'hidden',
49
            ),
50
            )
51
        );
52
        $this->add(
53
            array(
54
            'name' => 'state',
55
            'type' => 'select',
56
            'attributes' => array(
57
            'type'  => 'select',
58
            'options'    => array(
59
                    ''    => '---',
60
                    'allow'    => 'allow',
61
                    'deny'    => 'deny',
62
            ),
63
            ),
64
            )
65
        );
66
67
        $this->add(
68
            array(
69
            'name' => 'reset',
70
            'attributes' => array(
71
            'type'  => 'reset',
72
            'value' => 'reset',
73
            'id' => 'resetbutton',
74
            ),
75
            'options' => array(
76
            'label' => 'reset',
77
            ),
78
            )
79
        );
80
        $this->add(
81
            array(
82
            'name' => 'submit',
83
            'attributes' => array(
84
            'type'  => 'submit',
85
            'value' => 'save',
86
            'id' => 'submitbutton',
87
            ),
88
            'options' => array(
89
            'label' => 'save',
90
            ),
91
            )
92
        );
93
    }
94
}