1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace JhFlexiTime\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use ZfcUser\Entity\UserInterface; |
7
|
|
|
use JhFlexiTime\DateTime\DateTime; |
8
|
|
|
use JsonSerializable; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class UserSettings |
12
|
|
|
* @package JhFlexiTime\Entity |
13
|
|
|
* @author Aydin Hassan <[email protected]> |
14
|
|
|
* |
15
|
|
|
* @ORM\Entity |
16
|
|
|
* @ORM\Table(name="user_flexi_settings") |
17
|
|
|
*/ |
18
|
|
|
class UserSettings implements JsonSerializable |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\OneToOne(targetEntity="JhUser\Entity\User") |
23
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
24
|
|
|
*/ |
25
|
|
|
protected $user = null; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var DateTime |
29
|
|
|
* |
30
|
|
|
* @ORM\Column(type="date", name="flex_start_date", nullable=false) |
31
|
|
|
*/ |
32
|
|
|
protected $flexStartDate = null; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var \DateTime |
36
|
|
|
* |
37
|
|
|
* @ORM\Column(type="time", name="default_start_time", nullable=false) |
38
|
|
|
*/ |
39
|
|
|
protected $defaultStartTime = null; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var \DateTime |
43
|
|
|
* |
44
|
|
|
* @ORM\Column(type="time", name="default_end_time", nullable=false) |
45
|
|
|
*/ |
46
|
|
|
protected $defaultEndTime = null; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var float |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(type="float", name="start_balance", nullable=false) |
52
|
|
|
*/ |
53
|
|
|
protected $startingBalance = 0; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* |
57
|
|
|
* @param \ZfcUser\Entity\UserInterface $user |
58
|
|
|
* @return self |
59
|
|
|
*/ |
60
|
|
|
public function setUser(UserInterface $user) |
61
|
|
|
{ |
62
|
|
|
$this->user = $user; |
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return \ZfcUser\Entity\UserInterface |
68
|
|
|
*/ |
69
|
|
|
public function getUser() |
70
|
|
|
{ |
71
|
|
|
return $this->user; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param DateTime $defaultStartTime |
76
|
|
|
* @return self |
77
|
|
|
*/ |
78
|
|
|
public function setDefaultStartTime(DateTime $defaultStartTime) |
79
|
|
|
{ |
80
|
|
|
$this->defaultStartTime = $defaultStartTime; |
81
|
|
|
return $this; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return DateTime |
86
|
|
|
*/ |
87
|
|
|
public function getDefaultStartTime() |
88
|
|
|
{ |
89
|
|
|
return $this->defaultStartTime; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param DateTime $defaultEndTime |
94
|
|
|
* @return self |
95
|
|
|
*/ |
96
|
|
|
public function setDefaultEndTime(DateTime $defaultEndTime) |
97
|
|
|
{ |
98
|
|
|
$this->defaultEndTime = $defaultEndTime; |
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return DateTime |
104
|
|
|
*/ |
105
|
|
|
public function getDefaultEndTime() |
106
|
|
|
{ |
107
|
|
|
return $this->defaultEndTime; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param DateTime $flexStartDate |
112
|
|
|
* @return self |
113
|
|
|
*/ |
114
|
|
|
public function setFlexStartDate(DateTime $flexStartDate) |
115
|
|
|
{ |
116
|
|
|
$this->flexStartDate = $flexStartDate; |
117
|
|
|
return $this; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @return DateTime |
122
|
|
|
*/ |
123
|
|
|
public function getFlexStartDate() |
124
|
|
|
{ |
125
|
|
|
return $this->flexStartDate; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @param float $startingBalance |
130
|
|
|
* @return self |
131
|
|
|
*/ |
132
|
|
|
public function setStartingBalance($startingBalance) |
133
|
|
|
{ |
134
|
|
|
$this->startingBalance = $startingBalance; |
135
|
|
|
return $this; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @return float |
140
|
|
|
*/ |
141
|
|
|
public function getStartingBalance() |
142
|
|
|
{ |
143
|
|
|
return $this->startingBalance; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return array |
148
|
|
|
*/ |
149
|
|
|
public function jsonSerialize() |
150
|
|
|
{ |
151
|
|
|
return []; |
152
|
|
|
} |
153
|
|
|
} |
154
|
|
|
|