Completed
Push — master ( db8d28...797ef7 )
by wen
11:20
created

Select::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Sco\Admin\View\Filters;
4
5
class Select extends Filter
6
{
7
    protected $type = 'select';
8
9
    protected $options;
10
11
    public function __construct($name, $title, $options = null)
12
    {
13
        parent::__construct($name, $title);
14
15
        $this->setOptions($options);
16
    }
17
18
    /**
19
     * @return mixed
20
     */
21
    public function getOptions()
22
    {
23
        return $this->options;
24
    }
25
26
    /**
27
     * @param mixed $options
28
     *
29
     * @return Select
30
     */
31
    public function setOptions($options)
32
    {
33
        $this->options = $options;
34
        return $this;
35
    }
36
37
    public function toArray()
38
    {
39
        return parent::toArray() + [
40
                'options' => $this->getOptions(),
41
            ];
42
    }
43
}
44