ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilECSTimePlace Class Reference

Representation of ECS EContent Time Place. More...

+ Collaboration diagram for ilECSTimePlace:

Public Member Functions

 __construct ()
 Constructor. More...
 
 loadFromJson ($a_json)
 load from json More...
 
 setBegin ($a_begin)
 set begin More...
 
 getBegin ()
 get begin More...
 
 getUTBegin ()
 get begin as unix time More...
 
 setEnd ($a_end)
 set end More...
 
 getEnd ()
 get end More...
 
 getUTEnd ()
 get end as unix time More...
 
 setRoom ($a_room)
 set room More...
 
 getRoom ()
 get room More...
 
 setCycle ($a_cycle)
 set cycle More...
 
 getCycle ()
 get cycle More...
 

Data Fields

 $room = ''
 
 $begin = ''
 
 $end = ''
 
 $cycle = ''
 

Detailed Description

Representation of ECS EContent Time Place.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 34 of file class.ilECSTimePlace.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSTimePlace::__construct ( )

Constructor.

@access public

Parameters

Definition at line 48 of file class.ilECSTimePlace.php.

49 {
50
51 }

Member Function Documentation

◆ getBegin()

ilECSTimePlace::getBegin ( )

get begin

@access public

Definition at line 114 of file class.ilECSTimePlace.php.

115 {
116 return $this->begin;
117 }

References $begin.

◆ getCycle()

ilECSTimePlace::getCycle ( )

get cycle

@access public

Parameters

Definition at line 219 of file class.ilECSTimePlace.php.

220 {
221 return $this->cycle;
222 }

References $cycle.

◆ getEnd()

ilECSTimePlace::getEnd ( )

get end

@access public

Definition at line 159 of file class.ilECSTimePlace.php.

160 {
161 return $this->end;
162 }

References $end.

◆ getRoom()

ilECSTimePlace::getRoom ( )

get room

@access public

Definition at line 195 of file class.ilECSTimePlace.php.

196 {
197 return $this->room;
198 }

References $room.

◆ getUTBegin()

ilECSTimePlace::getUTBegin ( )

get begin as unix time

@access public

Definition at line 125 of file class.ilECSTimePlace.php.

126 {
127 include_once './Services/Calendar/classes/class.ilDateTime.php';
128 $dt = new ilDateTime($this->begin, IL_CAL_DATE, ilTimeZone::UTC);
129 return $dt->get(IL_CAL_UNIX);
130
131 }
const IL_CAL_DATE
const IL_CAL_UNIX
@classDescription Date and time handling

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

Referenced by loadFromJson().

+ Here is the caller graph for this function:

◆ getUTEnd()

ilECSTimePlace::getUTEnd ( )

get end as unix time

@access public

Definition at line 170 of file class.ilECSTimePlace.php.

171 {
172 include_once './Services/Calendar/classes/class.ilDateTime.php';
173 $dt = new ilDateTime($this->end, IL_CAL_DATE, ilTimeZone::UTC);
174 return $dt->get(IL_CAL_UNIX);
175 }

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

Referenced by loadFromJson().

+ Here is the caller graph for this function:

◆ loadFromJson()

ilECSTimePlace::loadFromJson (   $a_json)

load from json

@access public

Parameters
objectjson representation
Exceptions
ilException

Definition at line 60 of file class.ilECSTimePlace.php.

61 {
62 global $ilLog;
63
64 if(!is_object($a_json))
65 {
66 $ilLog->write(__METHOD__ . ': Cannot load from JSON. No object given.');
67 throw new ilException('Cannot parse ECSContent.');
68 }
69
70 $GLOBALS['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 {
81 $this->begin = '';
82 }
83 if(ilDate::_before(new ilDateTime($this->getUTEnd(),IL_CAL_UNIX), $two))
84 {
85 $this->end = '';
86 }
87 }
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.
Class for single dates.
getUTBegin()
get begin as unix time
getUTEnd()
get end as unix time
Base class for ILIAS Exception handling.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, $ilLog, ilDateTime\_before(), getUTBegin(), getUTEnd(), IL_CAL_DATE, and IL_CAL_UNIX.

+ Here is the call graph for this function:

◆ setBegin()

ilECSTimePlace::setBegin (   $a_begin)

set begin

@access public

Definition at line 95 of file class.ilECSTimePlace.php.

96 {
97 // is it unix time ?
98 if(is_numeric($a_begin) and $a_begin)
99 {
100 $dt = new ilDateTime($a_begin, IL_CAL_UNIX, ilTimeZone::UTC);
101 $this->end = $dt->get(IL_CAL_DATE);
102 }
103 else
104 {
105 $this->begin = $a_begin;
106 }
107 }

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

◆ setCycle()

ilECSTimePlace::setCycle (   $a_cycle)

set cycle

@access public

Parameters

Definition at line 207 of file class.ilECSTimePlace.php.

208 {
209 $this->cycle = $a_cycle;
210 }

◆ setEnd()

ilECSTimePlace::setEnd (   $a_end)

set end

@access public

Parameters
stringend

Definition at line 140 of file class.ilECSTimePlace.php.

141 {
142 // is it unix time ?
143 if(is_numeric($a_end) and $a_end)
144 {
145 $dt = new ilDateTime($a_end, IL_CAL_UNIX, ilTimeZone::UTC);
146 $this->end = $dt->get(IL_CAL_DATE);
147 }
148 else
149 {
150 $this->end = $a_end;
151 }
152 }

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

◆ setRoom()

ilECSTimePlace::setRoom (   $a_room)

set room

@access public

Parameters
stringroom

Definition at line 184 of file class.ilECSTimePlace.php.

185 {
186 $this->room = $a_room;
187 }

Field Documentation

◆ $begin

ilECSTimePlace::$begin = ''

Definition at line 37 of file class.ilECSTimePlace.php.

Referenced by getBegin().

◆ $cycle

ilECSTimePlace::$cycle = ''

Definition at line 39 of file class.ilECSTimePlace.php.

Referenced by getCycle().

◆ $end

ilECSTimePlace::$end = ''

Definition at line 38 of file class.ilECSTimePlace.php.

Referenced by getEnd().

◆ $room

ilECSTimePlace::$room = ''

Definition at line 36 of file class.ilECSTimePlace.php.

Referenced by getRoom().


The documentation for this class was generated from the following file: