Completed
Branch master (5acf81)
by Steevan
04:21
created

DateTimeCommonTrait   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 0
Metric Value
wmc 8
lcom 2
cbo 3
dl 0
loc 78
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setInput() 0 4 1
A getInput() 0 4 1
A setModelTimezone() 0 4 1
A getModelTimezone() 0 4 1
A setViewTimezone() 0 4 1
A getViewTimezone() 0 4 1
A setWidget() 0 4 1
A getWidget() 0 4 1
1
<?php
2
3
namespace steevanb\SymfonyFormOptionsBuilder\OptionsBuilder\Behavior;
4
5
use steevanb\SymfonyFormOptionsBuilder\Behavior\OptionAccessorsTrait;
6
7
trait DateTimeCommonTrait
8
{
9
    use OptionAccessorsTrait;
10
    use PlaceHolderTrait;
11
    use AutofocusTrait;
12
13
    /**
14
     * @param string $input
15
     * @return $this
16
     * @link http://symfony.com/doc/current/reference/forms/types/datetime.html#input
17
     */
18
    public function setInput($input)
19
    {
20
        return $this->setOption('input', $input);
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getInput()
27
    {
28
        return $this->getOption('input');
29
    }
30
31
    /**
32
     * @param string $timezone
33
     * @return $this
34
     * @link http://symfony.com/doc/current/reference/forms/types/date.html#model-timezone
35
     */
36
    public function setModelTimezone($timezone)
37
    {
38
        return $this->setOption('model_timezone', $timezone);
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getModelTimezone()
45
    {
46
        return $this->getOption('model_timezone');
47
    }
48
49
    /**
50
     * @param string $viewTimezone
51
     * @return $this
52
     * @link http://symfony.com/doc/current/reference/forms/types/date.html#view-timezone
53
     */
54
    public function setViewTimezone($viewTimezone)
55
    {
56
        return $this->setOption('view_timezone', $viewTimezone);
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getViewTimezone()
63
    {
64
        return $this->getOption('view_timezone');
65
    }
66
67
    /**
68
     * @param string $widget
69
     * @return $this
70
     * @link http://symfony.com/doc/current/reference/forms/types/date.html#widget
71
     */
72
    public function setWidget($widget)
73
    {
74
        return $this->setOption('widget', $widget);
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getWidget()
81
    {
82
        return $this->getOption('widget');
83
    }
84
}
85