1 |
03c02899
|
vastja
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace App\Entity;
|
4 |
|
|
|
5 |
70a3df53
|
vastja
|
/**
|
6 |
|
|
* Class wich represent From on heatmap page and is bind to that form.
|
7 |
|
|
*
|
8 |
|
|
* @see https://symfony.com/doc/current/forms.html
|
9 |
|
|
*/
|
10 |
03c02899
|
vastja
|
class DataSet {
|
11 |
|
|
protected $time;
|
12 |
|
|
protected $date;
|
13 |
|
|
protected $type;
|
14 |
|
|
|
15 |
|
|
public function setTime($time) {
|
16 |
|
|
$this->time = $time;
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
public function getTime() {
|
20 |
|
|
return $this->time;
|
21 |
|
|
}
|
22 |
|
|
|
23 |
1cf1413d
|
ballakt
|
public function getFormattedTime() {
|
24 |
|
|
return (strlen($this->time) <= 2) ? date('H:i', strtotime($this->time.':00')) : $this->time;
|
25 |
|
|
}
|
26 |
|
|
|
27 |
03c02899
|
vastja
|
public function setDate($date) {
|
28 |
03ccdd65
|
vastja
|
$this->date = date('Y-m-d', strtotime($date));
|
29 |
03c02899
|
vastja
|
}
|
30 |
|
|
|
31 |
|
|
public function getDate() {
|
32 |
|
|
return $this->date;
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
public function setType($type) {
|
36 |
|
|
$this->type = $type;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
public function getType() {
|
40 |
|
|
return $this->type;
|
41 |
|
|
}
|
42 |
|
|
}
|