ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

public

Parameters

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

49  {
50  }

Member Function Documentation

◆ getBegin()

ilECSTimePlace::getBegin ( )

get begin

public

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

References $begin.

110  {
111  return $this->begin;
112  }

◆ getCycle()

ilECSTimePlace::getCycle ( )

get cycle

public

Parameters

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

References $cycle.

211  {
212  return $this->cycle;
213  }

◆ getEnd()

ilECSTimePlace::getEnd ( )

get end

public

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

References $end.

151  {
152  return $this->end;
153  }

◆ getRoom()

ilECSTimePlace::getRoom ( )

get room

public

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

References $room.

187  {
188  return $this->room;
189  }

◆ getUTBegin()

ilECSTimePlace::getUTBegin ( )

get begin as unix time

public

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

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

Referenced by loadFromJson().

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  }
const IL_CAL_UNIX
Date and time handling
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ getUTEnd()

ilECSTimePlace::getUTEnd ( )

get end as unix time

public

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

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

Referenced by loadFromJson().

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  }
const IL_CAL_UNIX
Date and time handling
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ loadFromJson()

ilECSTimePlace::loadFromJson (   $a_json)

load from json

public

Parameters
objectjson representation
Exceptions
ilException

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

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

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  }
global $DIC
Definition: saml.php:7
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.
const IL_CAL_UNIX
Class for single dates.
Date and time handling
getUTBegin()
get begin as unix time
const IL_CAL_DATE
getUTEnd()
get end as unix time
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ setBegin()

ilECSTimePlace::setBegin (   $a_begin)

set begin

public

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

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

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  }
const IL_CAL_UNIX
Date and time handling
const IL_CAL_DATE

◆ setCycle()

ilECSTimePlace::setCycle (   $a_cycle)

set cycle

public

Parameters

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

199  {
200  $this->cycle = $a_cycle;
201  }

◆ setEnd()

ilECSTimePlace::setEnd (   $a_end)

set end

public

Parameters
stringend

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

References IL_CAL_DATE, IL_CAL_UNIX, and ilTimeZone\UTC.

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  }
const IL_CAL_UNIX
Date and time handling
const IL_CAL_DATE

◆ setRoom()

ilECSTimePlace::setRoom (   $a_room)

set room

public

Parameters
stringroom

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

176  {
177  $this->room = $a_room;
178  }

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: