Completed
Pull Request — 1.x (#641)
by
unknown
15:00
created

ChangeEmail::getAuthenticationOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace ZfcUser\Form;
4
5
use ZfcBase\Form\ProvidesEventsForm;
6
use ZfcUser\Options\AuthenticationOptionsInterface;
7
8
class ChangeEmail extends ProvidesEventsForm
9
{
10
    public function __construct($name, AuthenticationOptionsInterface $options)
11
    {
12
        $this->setAuthenticationOptions($options);
13
        parent::__construct($name);
14
15
        $this->add(array(
16
            'name' => 'identity',
17
            'options' => array(
18
                'label' => '',
19
            ),
20
            'attributes' => array(
21
                'type' => 'hidden',
22
            ),
23
        ));
24
25
        $this->add(array(
26
            'name' => 'newIdentity',
27
            'options' => array(
28
                'label' => 'New Email',
29
            ),
30
            'attributes' => array(
31
                'type' => 'text',
32
            ),
33
        ));
34
35
        $this->add(array(
36
            'name' => 'newIdentityVerify',
37
            'options' => array(
38
                'label' => 'Verify New Email',
39
            ),
40
            'attributes' => array(
41
                'type' => 'text',
42
            ),
43
        ));
44
45
        $this->add(array(
46
            'name' => 'credential',
47
            'type' => 'password',
48
            'options' => array(
49
                'label' => 'Password',
50
            ),
51
            'attributes' => array(
52
                'type' => 'password',
53
            ),
54
        ));
55
56
        $this->add(array(
57
            'name' => 'submit',
58
            'attributes' => array(
59
                'value' => 'Submit',
60
                'type'  => 'submit'
61
            ),
62
        ));
63
64
        $this->getEventManager()->trigger('init', $this);
65
    }
66
67
    /**
68
     * Set Authentication-related Options
69
     *
70
     * @param AuthenticationOptionsInterface $authOptions
71
     * @return Login
72
     */
73
    public function setAuthenticationOptions(AuthenticationOptionsInterface $authOptions)
74
    {
75
        $this->authOptions = $authOptions;
76
        return $this;
77
    }
78
79
    /**
80
     * Get Authentication-related Options
81
     *
82
     * @return AuthenticationOptionsInterface
83
     */
84
    public function getAuthenticationOptions()
85
    {
86
        return $this->authOptions;
87
    }
88
}
89