Completed
Push — feature/update_flight ( 289873 )
by Laurent
18:14
created

Select::getValueOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
namespace flightlog\form;
7
8
/**
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class Select extends BaseInput
12
{
13
14
    /**
15
     * @var array
16
     */
17
    private $valueOptions;
18
19
    /**
20
     * @param string $name
21
     * @param array  $options
22
     */
23
    public function __construct($name, $options = [])
24
    {
25
        parent::__construct($name, FormElementInterface::TYPE_SELECT, $options);
26
        $this->valueOptions = [];
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function getValueOptions()
33
    {
34
        return $this->valueOptions;
35
    }
36
37
    /**
38
     * @param array $valueOptions
39
     *
40
     * @return Select
41
     */
42
    public function setValueOptions($valueOptions)
43
    {
44
        $this->valueOptions = $valueOptions;
45
        return $this;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public function setValue($value)
52
    {
53
        parent::setValue($value);
54
        $this->valueOptions[$value] = $value;
55
    }
56
57
58
}