Issues (762)

plugins/calender/classes/event.php (1 issue)

Severity
1
<?php
2
3
/**
4
 * Copyright (c) 2018 Justin Kuenzel (jukusoft.com)
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
20
/**
21
 * Project: RocketCMS
22
 * License: Apache 2.0 license
23
 * User: Justin
24
 * Date: 27.04.2018
25
 * Time: 01:11
26
 */
27
28
namespace Plugin\Calender;
29
30
class Event {
31
32
	protected $row = null;
33
34
	public function __construct(array $row) {
35
		$this->row = $row;
36
	}
37
38
	public function getID () : int {
39
		return $this->row['id'];
40
	}
41
42
	public function getCalenderID () : int {
43
		return $this->row['calenderID'];
44
	}
45
46
	public function getTitle () : string {
47
		return utf8_encode($this->row['title']);
48
	}
49
50
	public function getDescription () : string {
51
		return utf8_encode($this->row['description']);
52
	}
53
54
	public function getPriceInfo () : string {
55
		return (isset($this->row['price_info']) ? $this->row['price_info'] : "");
56
	}
57
58
	public function hasImage () : bool {
59
		return $this->row['image'] !== "none";
60
	}
61
62
	public function getImage () : string {
63
		return $this->row['image'];
64
	}
65
66
	public function isAllDay () : bool {
67
		return $this->row['all_day'] == 1;
68
	}
69
70
	public function getFromTimestamp () : string {
71
		return $this->row['from_date'];
72
	}
73
74
	public function getToTimestamp () : string {
75
		return $this->row['to_date'];
76
	}
77
78
	public function getLocation () : string {
79
		return utf8_encode($this->row['location']);
80
	}
81
82
	public function hasColor () : bool {
83
		return $this->row['color'] !== "none";
84
	}
85
86
	public function getColor () : string {
87
		return $this->row['color'];
88
	}
89
90
	public function isActivated () : bool {
91
		return $this->row['activated'] == 1;
92
	}
93
94
	public static function castEvent (Event $event) : Event {
95
		return $event;
96
	}
97
98
}
99
100
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
101