-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEvent.php
More file actions
108 lines (94 loc) · 2.03 KB
/
Event.php
File metadata and controls
108 lines (94 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
require_once "TypeCour.php";
require_once "CollectionTypesCours.php";
class Event
{
public $title = '';
public $start = '';
public $end = '';
public $type = '';
public $location = '';
public function toString() {
$arr = [];
$arr["title"] = $this->title;
$arr["start"] = $this->start;
$arr["end"] = $this->end;
$arr["type"] = $this->type;
$arr["location"] = $this->location;
return json_encode($arr);
}
/**
* @param string $title
*/
public function setType(string $title)
{
$oCollectionTypesCours = new CollectionTypesCours();
$aTypesCours = $oCollectionTypesCours->getCollectionTypesCours();
$aTypesCoursIndexName = array_column($aTypesCours, 'name',"name");
foreach ($aTypesCoursIndexName as $oValue) {
if (preg_match('/'.$oValue.'/i', $title) === 1) {
$this->type = $oValue;
}
}
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @param string $title
*/
public function setTitle(string $title)
{
$this->title = $title;
}
/**
* @return string
*/
public function getStart(): string
{
return $this->start;
}
/**
* @param string $start
*/
public function setStart(string $start)
{
$this->start = $start;
}
/**
* @return string
*/
public function getEnd(): string
{
return $this->end;
}
/**
* @param string $end
*/
public function setEnd(string $end)
{
$this->end = $end;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
public function setLocation($location)
{
$this->location = $location;
}
/**
* @return string
*/
public function getLocation(): string
{
return $this->location;
}
}