Completed
Push — master ( 650783...0c9838 )
by wen
15:06
created

DateRange::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\Display\Filters;
4
5
class DateRange extends Filter
6
{
7
    protected $type = 'daterange';
8
9
    protected $pickerFormat = 'yyyy-MM-dd';
10
11
    protected $defaultValue = [];
12
13
    protected $operator = 'between';
14
15
    /**
16
     * @return string
17
     */
18
    public function getPickerFormat(): string
19
    {
20
        return $this->pickerFormat;
21
    }
22
23
    /**
24
     * @param string $pickerFormat
25
     *
26
     * @return DateRange
27
     */
28
    public function setPickerFormat(string $pickerFormat): DateRange
29
    {
30
        $this->pickerFormat = $pickerFormat;
31
32
        return $this;
33
    }
34
35
    public function toArray()
36
    {
37
        return parent::toArray() + [
38
                'pickerFormat' => $this->getPickerFormat(),
39
            ];
40
    }
41
}
42