GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Workday::getNotes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2016: Luis Ramón López López
6
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU Affero General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
11
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU Affero General Public License for more details.
16
17
  You should have received a copy of the GNU Affero General Public License
18
  along with this program.  If not, see [http://www.gnu.org/licenses/].
19
*/
20
21
namespace AppBundle\Entity;
22
23
use Doctrine\Common\Collections\ArrayCollection;
24
use Doctrine\Common\Collections\Collection;
25
use Doctrine\ORM\Mapping as ORM;
26
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
27
28
/**
29
 * @ORM\Entity(repositoryClass="WorkdayRepository")
30
 * @UniqueEntity(fields={"agreement", "date"})
31
 */
32
class Workday
33
{
34
    /**
35
     * @ORM\Id
36
     * @ORM\GeneratedValue
37
     * @ORM\Column(type="integer")
38
     * @var int
39
     */
40
    protected $id;
41
    
42
    /**
43
     * @ORM\ManyToOne(targetEntity="Agreement", inversedBy="workdays")
44
     * @var Agreement
45
     */
46
    protected $agreement;
47
48
    /**
49
     * @ORM\Column(type="date")
50
     * @var \DateTime
51
     */
52
    protected $date;
53
54
    /**
55
     * @ORM\Column(type="text", nullable=true)
56
     * @var string
57
     */
58
    protected $notes;
59
60
    /**
61
     * @ORM\Column(type="float")
62
     * @var float
63
     */
64
    protected $hours;
65
66
    /**
67
     * @ORM\OneToMany(targetEntity="Tracking", mappedBy="workday", fetch="EAGER")
68
     * @var Collection
69
     */
70
    protected $trackingActivities;
71
72
    /**
73
     * @ORM\Column(type="boolean")
74
     * @var bool
75
     */
76
    protected $locked;
77
78
    /**
79
     * Get id
80
     *
81
     * @return integer
82
     */
83
    public function getId()
84
    {
85
        return $this->id;
86
    }
87
88
    /**
89
     * Set date
90
     *
91
     * @param \DateTime $date
92
     *
93
     * @return Workday
94
     */
95
    public function setDate($date)
96
    {
97
        $this->date = $date;
98
99
        return $this;
100
    }
101
102
    /**
103
     * Get date
104
     *
105
     * @return \DateTime
106
     */
107
    public function getDate()
108
    {
109
        return $this->date;
110
    }
111
    
112
    /**
113
     * Set notes
114
     *
115
     * @param string $notes
116
     *
117
     * @return Workday
118
     */
119
    public function setNotes($notes)
120
    {
121
        $this->notes = $notes;
122
123
        return $this;
124
    }
125
126
    /**
127
     * Get notes
128
     *
129
     * @return string
130
     */
131
    public function getNotes()
132
    {
133
        return $this->notes;
134
    }
135
136
    /**
137
     * Set hours
138
     *
139
     * @param float $hours
140
     *
141
     * @return Workday
142
     */
143
    public function setHours($hours)
144
    {
145
        $this->hours = $hours;
146
147
        return $this;
148
    }
149
150
    /**
151
     * Get hours
152
     *
153
     * @return float
154
     */
155
    public function getHours()
156
    {
157
        return $this->hours;
158
    }
159
160
    /**
161
     * Set agreement
162
     *
163
     * @param Agreement $agreement
164
     *
165
     * @return Workday
166
     */
167
    public function setAgreement(Agreement $agreement = null)
168
    {
169
        $this->agreement = $agreement;
170
171
        return $this;
172
    }
173
174
    /**
175
     * Get agreement
176
     *
177
     * @return Agreement
178
     */
179
    public function getAgreement()
180
    {
181
        return $this->agreement;
182
    }
183
    /**
184
     * Constructor
185
     */
186
    public function __construct()
187
    {
188
        $this->trackingActivities = new ArrayCollection();
189
        $this->setLocked(false);
190
    }
191
192
    /**
193
     * Add trackingActivity
194
     *
195
     * @param Tracking $trackingActivity
196
     *
197
     * @return Workday
198
     */
199
    public function addTrackingActivity(Tracking $trackingActivity)
200
    {
201
        $this->trackingActivities[] = $trackingActivity;
202
203
        return $this;
204
    }
205
206
    /**
207
     * Remove trackingActivity
208
     *
209
     * @param Tracking $trackingActivity
210
     */
211
    public function removeTrackingActivity(Tracking $trackingActivity)
212
    {
213
        $this->trackingActivities->removeElement($trackingActivity);
214
    }
215
216
    /**
217
     * Get trackingActivities
218
     *
219
     * @return \Doctrine\Common\Collections\Collection
220
     */
221
    public function getTrackingActivities()
222
    {
223
        return $this->trackingActivities;
224
    }
225
226
    /**
227
     * @return float
228
     */
229
    public function getTrackedHours()
230
    {
231
        $hours = 0.0;
232
        /** @var Tracking $track */
233
        foreach ($this->getTrackingActivities() as $track) {
234
            $hours += $track->getHours();
235
        }
236
237
        return $hours;
238
    }
239
240
    /**
241
     * Set locked
242
     *
243
     * @param boolean $locked
244
     *
245
     * @return Workday
246
     */
247
    public function setLocked($locked)
248
    {
249
        $this->locked = $locked;
250
251
        return $this;
252
    }
253
254
    /**
255
     * Is locked
256
     *
257
     * @return boolean
258
     */
259
    public function isLocked()
260
    {
261
        return $this->locked;
262
    }
263
}
264