ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
51  }

Member Function Documentation

◆ getBegin()

ilECSTimePlace::getBegin ( )

get begin

public

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

References $begin.

104  {
105  return $this->begin;
106  }

◆ getCycle()

ilECSTimePlace::getCycle ( )

get cycle

public

Parameters

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

References $cycle.

218  {
219  return $this->cycle;
220  }

◆ getEnd()

ilECSTimePlace::getEnd ( )

get end

public

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

References $end.

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

◆ getRoom()

ilECSTimePlace::getRoom ( )

get room

public

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

References $room.

194  {
195  return $this->room;
196  }

◆ getUTBegin()

ilECSTimePlace::getUTBegin ( )

get begin as unix time

public

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

115  {
116  if(!@include_once('Date.php'))
117  {
118  return time();
119  }
120 
121  $date = new Date();
122  $date->setDate($this->begin);
123  return $date->getDate(DATE_FORMAT_UNIXTIME);
124  }

◆ getUTEnd()

ilECSTimePlace::getUTEnd ( )

get end as unix time

public

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

163  {
164 
165  if(!@include_once('Date.php'))
166  {
167  return time();
168  }
169 
170  $date = new Date();
171  $date->setDate($this->end);
172  return $date->getDate(DATE_FORMAT_UNIXTIME);
173  }

◆ loadFromJson()

ilECSTimePlace::loadFromJson (   $a_json)

load from json

public

Parameters
objectjson representation
Exceptions
ilException

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

References $GLOBALS, and $ilLog.

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  }
Base class for ILIAS Exception handling.
$GLOBALS['ct_recipient']

◆ setBegin()

ilECSTimePlace::setBegin (   $a_begin)

set begin

public

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

86  {
87  // is it unix time ?
88  if(is_numeric($a_begin) and $a_begin)
89  {
90  $this->begin = date('c', $a_begin);
91  }
92  else
93  {
94  $this->begin = $a_begin;
95  }
96  }

◆ setCycle()

ilECSTimePlace::setCycle (   $a_cycle)

set cycle

public

Parameters

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

206  {
207  $this->cycle = $a_cycle;
208  }

◆ setEnd()

ilECSTimePlace::setEnd (   $a_end)

set end

public

Parameters
stringend

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

134  {
135  // is it unix time ?
136  if(is_numeric($a_end) and $a_end)
137  {
138  $this->end = date('c', $a_end);
139  }
140  else
141  {
142  $this->end = $a_end;
143  }
144  }

◆ setRoom()

ilECSTimePlace::setRoom (   $a_room)

set room

public

Parameters
stringroom

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

183  {
184  $this->room = $a_room;
185  }

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: