ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSTimePlace.php
Go to the documentation of this file.
1
<?
php
2
3
/*
4
+-----------------------------------------------------------------------------+
5
| ILIAS open source |
6
+-----------------------------------------------------------------------------+
7
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
8
| |
9
| This program is free software; you can redistribute it and/or |
10
| modify it under the terms of the GNU General Public License |
11
| as published by the Free Software Foundation; either version 2 |
12
| of the License, or (at your option) any later version. |
13
| |
14
| This program is distributed in the hope that it will be useful, |
15
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
| GNU General Public License for more details. |
18
| |
19
| You should have received a copy of the GNU General Public License |
20
| along with this program; if not, write to the Free Software |
21
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
22
+-----------------------------------------------------------------------------+
23
*/
24
34
class
ilECSTimePlace
35
{
36
public
$room
=
''
;
37
public
$begin
=
''
;
38
public
$end
=
''
;
39
public
$cycle
=
''
;
40
48
public
function
__construct
()
49
{
50
}
51
59
public
function
loadFromJson
($a_json)
60
{
61
global
$DIC
;
62
63
$ilLog
= $DIC[
'ilLog'
];
64
65
if
(!is_object($a_json)) {
66
$ilLog
->write(__METHOD__ .
': Cannot load from JSON. No object given.'
);
67
throw
new
ilException
(
'Cannot parse ECSContent.'
);
68
}
69
70
$GLOBALS
[
'DIC'
][
'ilLog'
]->write(__METHOD__ .
': '
. print_r($a_json,
true
));
71
72
$this->room = $a_json->room;
73
$this->begin = $a_json->begin;
74
$this->end = $a_json->end;
75
$this->cycle = $a_json->cycle;
76
#$this->day = $a_json->day;
77
78
$two =
new
ilDate
(
'2000-01-02'
,
IL_CAL_DATE
);
79
if
(
ilDate::_before
(
new
ilDateTime
($this->
getUTBegin
(),
IL_CAL_UNIX
), $two)) {
80
$this->begin =
''
;
81
}
82
if
(
ilDate::_before
(
new
ilDateTime
($this->
getUTEnd
(),
IL_CAL_UNIX
), $two)) {
83
$this->end =
''
;
84
}
85
}
86
93
public
function
setBegin
($a_begin)
94
{
95
// is it unix time ?
96
if
(is_numeric($a_begin)
and
$a_begin) {
97
$dt =
new
ilDateTime
($a_begin,
IL_CAL_UNIX
,
ilTimeZone::UTC
);
98
$this->end = $dt->get(
IL_CAL_DATE
);
99
}
else
{
100
$this->begin = $a_begin;
101
}
102
}
103
109
public
function
getBegin
()
110
{
111
return
$this->begin
;
112
}
113
120
public
function
getUTBegin
()
121
{
122
include_once
'./Services/Calendar/classes/class.ilDateTime.php'
;
123
$dt =
new
ilDateTime
($this->begin,
IL_CAL_DATE
,
ilTimeZone::UTC
);
124
return
$dt->get(
IL_CAL_UNIX
);
125
}
126
134
public
function
setEnd
($a_end)
135
{
136
// is it unix time ?
137
if
(is_numeric($a_end)
and
$a_end) {
138
$dt =
new
ilDateTime
($a_end,
IL_CAL_UNIX
,
ilTimeZone::UTC
);
139
$this->end = $dt->get(
IL_CAL_DATE
);
140
}
else
{
141
$this->end = $a_end;
142
}
143
}
144
150
public
function
getEnd
()
151
{
152
return
$this->end
;
153
}
154
161
public
function
getUTEnd
()
162
{
163
include_once
'./Services/Calendar/classes/class.ilDateTime.php'
;
164
$dt =
new
ilDateTime
($this->end,
IL_CAL_DATE
,
ilTimeZone::UTC
);
165
return
$dt->get(
IL_CAL_UNIX
);
166
}
167
175
public
function
setRoom
($a_room)
176
{
177
$this->room = $a_room;
178
}
179
186
public
function
getRoom
()
187
{
188
return
$this->room
;
189
}
190
198
public
function
setCycle
($a_cycle)
199
{
200
$this->cycle = $a_cycle;
201
}
202
210
public
function
getCycle
()
211
{
212
return
$this->cycle
;
213
}
214
}
ilECSTimePlace\setRoom
setRoom($a_room)
set room
Definition:
class.ilECSTimePlace.php:175
ilECSTimePlace\$end
$end
Definition:
class.ilECSTimePlace.php:38
ilException
ilECSTimePlace
Representation of ECS EContent Time Place.
Definition:
class.ilECSTimePlace.php:34
$DIC
global $DIC
Definition:
saml.php:7
ilTimeZone\UTC
const UTC
Definition:
class.ilTimeZone.php:45
ilECSTimePlace\getBegin
getBegin()
get begin
Definition:
class.ilECSTimePlace.php:109
ilDateTime\_before
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Definition:
class.ilDateTime.php:157
ilECSTimePlace\$begin
$begin
Definition:
class.ilECSTimePlace.php:37
ilECSTimePlace\$room
$room
Definition:
class.ilECSTimePlace.php:36
ilECSTimePlace\setCycle
setCycle($a_cycle)
set cycle
Definition:
class.ilECSTimePlace.php:198
IL_CAL_UNIX
const IL_CAL_UNIX
Definition:
class.ilDateTime.php:11
ilDate
Class for single dates.
Definition:
class.ilDate.php:36
ilECSTimePlace\getRoom
getRoom()
get room
Definition:
class.ilECSTimePlace.php:186
ilECSTimePlace\getCycle
getCycle()
get cycle
Definition:
class.ilECSTimePlace.php:210
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:33
ilECSTimePlace\loadFromJson
loadFromJson($a_json)
load from json
Definition:
class.ilECSTimePlace.php:59
ilECSTimePlace\getUTBegin
getUTBegin()
get begin as unix time
Definition:
class.ilECSTimePlace.php:120
$ilLog
$ilLog
Definition:
inc.setup_header.php:123
ilECSTimePlace\setBegin
setBegin($a_begin)
set begin
Definition:
class.ilECSTimePlace.php:93
ilECSTimePlace\__construct
__construct()
Constructor.
Definition:
class.ilECSTimePlace.php:48
IL_CAL_DATE
const IL_CAL_DATE
Definition:
class.ilDateTime.php:10
ilECSTimePlace\setEnd
setEnd($a_end)
set end
Definition:
class.ilECSTimePlace.php:134
php
and
ilECSTimePlace\getEnd
getEnd()
get end
Definition:
class.ilECSTimePlace.php:150
ilECSTimePlace\getUTEnd
getUTEnd()
get end as unix time
Definition:
class.ilECSTimePlace.php:161
ilECSTimePlace\$cycle
$cycle
Definition:
class.ilECSTimePlace.php:39
$GLOBALS
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Definition:
module.tag.xmp.php:702
Services
WebServices
ECS
classes
class.ilECSTimePlace.php
Generated on Thu Jan 16 2025 19:02:34 for ILIAS by
1.8.13 (using
Doxyfile
)