ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSessionAppointment Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSessionAppointment:
+ Collaboration diagram for ilSessionAppointment:

Public Member Functions

 __construct (int $a_appointment_id=0)
 
 isFullday ()
 is event a fullday period More...
 
 getStart ()
 Get start of date period. More...
 
 setStart (ilDateTime $a_start)
 
 getEnd ()
 Get end of period. More...
 
 setEnd (ilDateTime $a_end)
 
 setAppointmentId (int $a_appointment_id)
 
 getAppointmentId ()
 
 setSessionId (int $a_session_id)
 
 getSessionId ()
 
 setStartingTime (int $a_starting_time)
 
 getStartingTime ()
 
 setEndingTime (int $a_ending_time)
 
 getEndingTime ()
 
 toggleFullTime (bool $a_status)
 
 enabledFullTime ()
 
 formatTime ()
 
 timeToString (int $start, int $end)
 
 appointmentToString ()
 
 cloneObject (int $new_id)
 
 create ()
 
 update ()
 
 delete ()
 
 validate ()
 

Static Public Member Functions

static _lookupAppointment (int $a_obj_id)
 
static lookupNextSessionByCourse (int $a_ref_id)
 
static lookupLastSessionByCourse (int $a_ref_id)
 
static _appointmentToString (int $start, int $end, bool $fulltime)
 
static _delete (int $a_appointment_id)
 
static _deleteBySession (int $a_event_id)
 
static _readAppointmentsBySession (int $a_event_id)
 

Protected Member Functions

 __read ()
 

Protected Attributes

ilErrorHandling $ilErr
 
ilDBInterface $db
 
ilTree $tree
 
ilLanguage $lng
 
ilDateTime $start = null
 
ilDateTime $end = null
 
int $starting_time = 0
 
int $ending_time = 0
 
bool $fulltime = false
 
int $appointment_id = 0
 
int $session_id = 0
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning class ilSessionAppointment

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 30 of file class.ilSessionAppointment.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionAppointment::__construct ( int  $a_appointment_id = 0)

Definition at line 44 of file class.ilSessionAppointment.php.

References $DIC, __read(), and ILIAS\Repository\lng().

45  {
46  global $DIC;
47 
48  $this->ilErr = $DIC['ilErr'];
49  $this->db = $DIC->database();
50  $this->tree = $DIC->repositoryTree();
51  $this->lng = $DIC->language();
52 
53  $this->appointment_id = $a_appointment_id;
54  $this->__read();
55  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilSessionAppointment::__read ( )
protected

Definition at line 388 of file class.ilSessionAppointment.php.

References $db, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, getAppointmentId(), IL_CAL_DATETIME, ILIAS\Repository\int(), isFullday(), setSessionId(), and toggleFullTime().

Referenced by __construct().

388  : ?bool
389  {
390  $ilDB = $this->db;
391 
392  if (!$this->getAppointmentId()) {
393  return null;
394  }
395 
396  $query = "SELECT * FROM event_appointment " .
397  "WHERE appointment_id = " . $ilDB->quote($this->getAppointmentId(), 'integer') . " ";
398  $res = $this->db->query($query);
399  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
400  $this->setSessionId((int) $row->event_id);
401  $this->toggleFullTime((bool) $row->fulltime);
402 
403  if ($this->isFullday()) {
404  $this->start = new ilDate($row->e_start, IL_CAL_DATETIME);
405  $this->end = new ilDate($row->e_end, IL_CAL_DATETIME);
406  } else {
407  $this->start = new ilDateTime($row->e_start, IL_CAL_DATETIME, 'UTC');
408  $this->end = new ilDateTime($row->e_end, IL_CAL_DATETIME, 'UTC');
409  }
410  $this->starting_time = (int) $this->start->getUnixTime();
411  $this->ending_time = (int) $this->end->getUnixTime();
412  }
413  return true;
414  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
$query
isFullday()
is event a fullday period
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _appointmentToString()

static ilSessionAppointment::_appointmentToString ( int  $start,
int  $end,
bool  $fulltime 
)
static

Definition at line 253 of file class.ilSessionAppointment.php.

References $DIC, ilDatePresentation\formatPeriod(), IL_CAL_UNIX, and ilLanguage\txt().

Referenced by ilCourseContentGUI\__renderUserItem(), ilObjectListGUI\getAsCard(), ilRepositoryExplorerGUI\getNodeContent(), ilObjSessionListGUI\getTitle(), ilObjectCopySelectionTableGUI\parseSource(), ilTimingsPersonalTableGUI\parseTitle(), ilTimingsManageTableGUI\parseTitle(), and ilSessionMailTemplateParticipantContext\resolveSpecificPlaceholder().

253  : string
254  {
255  global $DIC;
256 
257  $lng = $DIC->language();
258 
259  if ($fulltime) {
261  new ilDate($start, IL_CAL_UNIX),
262  #new ilDate($end,IL_CAL_UNIX)).' ('.$lng->txt('event_full_time_info').')';
263  new ilDate($end, IL_CAL_UNIX)
264  );
265  } else {
269  );
270  }
271  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _delete()

static ilSessionAppointment::_delete ( int  $a_appointment_id)
static

Definition at line 335 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, and $res.

335  : bool
336  {
337  global $DIC;
338 
339  $ilDB = $DIC->database();
340 
341  $query = "DELETE FROM event_appointment " .
342  "WHERE appointment_id = " . $ilDB->quote($a_appointment_id, 'integer') . " ";
343  $res = $ilDB->manipulate($query);
344 
345  return true;
346  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query

◆ _deleteBySession()

static ilSessionAppointment::_deleteBySession ( int  $a_event_id)
static

Definition at line 348 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjSession\delete().

348  : bool
349  {
350  global $DIC;
351 
352  $ilDB = $DIC->database();
353 
354  $query = "DELETE FROM event_appointment " .
355  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " ";
356  $res = $ilDB->manipulate($query);
357 
358  return true;
359  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _lookupAppointment()

static ilSessionAppointment::_lookupAppointment ( int  $a_obj_id)
static

Definition at line 57 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and IL_CAL_DATETIME.

Referenced by ilCourseContentGUI\__renderUserItem(), ilLPStatusEvent\_getStatusInfo(), ilObjectActivation\addAdditionalSubItemInformation(), ilLPStatusEvent\determineStatus(), ilObjSessionListGUI\getAppointmentInfo(), ilObjectListGUI\getAsCard(), ilRepositoryExplorerGUI\getNodeContent(), ilObjectCopySelectionTableGUI\parseSource(), ilTimingsPersonalTableGUI\parseTitle(), ilTimingsManageTableGUI\parseTitle(), ilSessionMailTemplateParticipantContext\resolveSpecificPlaceholder(), and ilRepositoryExplorerGUI\sortChilds().

57  : array
58  {
59  global $DIC;
60 
61  $ilDB = $DIC->database();
62 
63  $query = "SELECT * FROM event_appointment " .
64  "WHERE event_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
65  $res = $ilDB->query($query);
66  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
67  $info['fullday'] = $row->fulltime;
68 
69  $date = new ilDateTime($row->e_start, IL_CAL_DATETIME, 'UTC');
70  $info['start'] = $date->getUnixTime();
71  $date = new ilDateTime($row->e_end, IL_CAL_DATETIME, 'UTC');
72  $info['end'] = $date->getUnixTime();
73 
74  return $info;
75  }
76  return [];
77  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _readAppointmentsBySession()

static ilSessionAppointment::_readAppointmentsBySession ( int  $a_event_id)
static

Definition at line 361 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjSession\initAppointments().

361  : array
362  {
363  global $DIC;
364 
365  $ilDB = $DIC->database();
366 
367  $query = "SELECT * FROM event_appointment " .
368  "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
369  "ORDER BY starting_time";
370 
371  $res = $ilDB->query($query);
372  $appointments = [];
373  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
374  $appointments[] = new ilSessionAppointment((int) $row->appointment_id);
375  }
376  return $appointments;
377  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ appointmentToString()

ilSessionAppointment::appointmentToString ( )

Definition at line 273 of file class.ilSessionAppointment.php.

References getEndingTime(), getStartingTime(), and isFullday().

273  : string
274  {
275  return self::_appointmentToString($this->getStartingTime(), $this->getEndingTime(), $this->isFullday());
276  }
isFullday()
is event a fullday period
+ Here is the call graph for this function:

◆ cloneObject()

ilSessionAppointment::cloneObject ( int  $new_id)

Definition at line 278 of file class.ilSessionAppointment.php.

References enabledFullTime(), getEndingTime(), and getStartingTime().

278  : self
279  {
280  $new_app = new ilSessionAppointment();
281  $new_app->setSessionId($new_id);
282  $new_app->setStartingTime($this->getStartingTime());
283  $new_app->setEndingTime($this->getEndingTime());
284  $new_app->toggleFullTime($this->enabledFullTime());
285  $new_app->create();
286 
287  return $new_app;
288  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ create()

ilSessionAppointment::create ( )

Definition at line 290 of file class.ilSessionAppointment.php.

References $db, $ilDB, $query, $res, enabledFullTime(), getEnd(), getSessionId(), getStart(), and IL_CAL_DATETIME.

290  : bool
291  {
292  $ilDB = $this->db;
293 
294  if (!$this->getSessionId()) {
295  return false;
296  }
297  $next_id = $ilDB->nextId('event_appointment');
298  $query = "INSERT INTO event_appointment (appointment_id,event_id,e_start,e_end,fulltime) " .
299  "VALUES( " .
300  $ilDB->quote($next_id, 'integer') . ", " .
301  $ilDB->quote($this->getSessionId(), 'integer') . ", " .
302  $ilDB->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
303  $ilDB->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
304  $ilDB->quote((int) $this->enabledFullTime(), 'integer') . " " .
305  ")";
306  $this->appointment_id = $next_id;
307  $res = $ilDB->manipulate($query);
308 
309  return true;
310  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
getStart()
Get start of date period.
$query
+ Here is the call graph for this function:

◆ delete()

ilSessionAppointment::delete ( )

Definition at line 330 of file class.ilSessionAppointment.php.

References getAppointmentId().

330  : bool
331  {
332  return self::_delete($this->getAppointmentId());
333  }
+ Here is the call graph for this function:

◆ enabledFullTime()

ilSessionAppointment::enabledFullTime ( )

Definition at line 233 of file class.ilSessionAppointment.php.

References $fulltime.

Referenced by cloneObject(), create(), isFullday(), and update().

233  : bool
234  {
235  return $this->fulltime;
236  }
+ Here is the caller graph for this function:

◆ formatTime()

ilSessionAppointment::formatTime ( )

Definition at line 238 of file class.ilSessionAppointment.php.

References getEndingTime(), getStartingTime(), and timeToString().

238  : string
239  {
240  return $this->timeToString($this->getStartingTime(), $this->getEndingTime());
241  }
timeToString(int $start, int $end)
+ Here is the call graph for this function:

◆ getAppointmentId()

ilSessionAppointment::getAppointmentId ( )

Definition at line 194 of file class.ilSessionAppointment.php.

References $appointment_id.

Referenced by __read(), delete(), and update().

194  : int
195  {
196  return $this->appointment_id;
197  }
+ Here is the caller graph for this function:

◆ getEnd()

ilSessionAppointment::getEnd ( )

Get end of period.

Implements ilDatePeriod.

Definition at line 179 of file class.ilSessionAppointment.php.

References IL_CAL_DATETIME.

Referenced by create(), and update().

179  : ?ilDateTime
180  {
181  return $this->end ?: $this->end = new ilDateTime(date('Y-m-d') . ' 16:00:00', IL_CAL_DATETIME);
182  }
const IL_CAL_DATETIME
+ Here is the caller graph for this function:

◆ getEndingTime()

ilSessionAppointment::getEndingTime ( )

Definition at line 224 of file class.ilSessionAppointment.php.

Referenced by appointmentToString(), cloneObject(), and formatTime().

224  : int
225  {
226  return $this->ending_time ?? mktime(16, 0, 0, (int) date('n', time()), (int) date('j', time()), (int) date('Y', time()));
227  }
+ Here is the caller graph for this function:

◆ getSessionId()

ilSessionAppointment::getSessionId ( )

Definition at line 203 of file class.ilSessionAppointment.php.

References $session_id.

Referenced by create(), and update().

203  : int
204  {
205  return $this->session_id;
206  }
+ Here is the caller graph for this function:

◆ getStart()

ilSessionAppointment::getStart ( )

Get start of date period.

Implements ilDatePeriod.

Definition at line 169 of file class.ilSessionAppointment.php.

References IL_CAL_DATETIME.

Referenced by create(), and update().

169  : ?ilDateTime
170  {
171  return $this->start ?: $this->start = new ilDateTime(date('Y-m-d') . ' 08:00:00', IL_CAL_DATETIME);
172  }
const IL_CAL_DATETIME
+ Here is the caller graph for this function:

◆ getStartingTime()

ilSessionAppointment::getStartingTime ( )

Definition at line 214 of file class.ilSessionAppointment.php.

Referenced by appointmentToString(), cloneObject(), and formatTime().

214  : int
215  {
216  return $this->starting_time ?? mktime(8, 0, 0, (int) date('n', time()), (int) date('j', time()), (int) date('Y', time()));
217  }
+ Here is the caller graph for this function:

◆ isFullday()

ilSessionAppointment::isFullday ( )

is event a fullday period

Implements ilDatePeriod.

Definition at line 164 of file class.ilSessionAppointment.php.

References enabledFullTime().

Referenced by __read(), and appointmentToString().

164  : bool
165  {
166  return $this->enabledFullTime();
167  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupLastSessionByCourse()

static ilSessionAppointment::lookupLastSessionByCourse ( int  $a_ref_id)
static
Returns
bool|int

Definition at line 137 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilTree\getChildsByType(), and ILIAS\Repository\int().

Referenced by ilContainerSimpleContentGUI\initDetails(), ilContainerByTypeContentGUI\initDetails(), and ilContainerSessionsContentGUI\initDetails().

138  {
139  global $DIC;
140 
141  $tree = $DIC->repositoryTree();
142  $ilDB = $DIC->database();
143 
144  $sessions = $tree->getChildsByType($a_ref_id, 'sess');
145  $obj_ids = [];
146  foreach ($sessions as $tree_data) {
147  $obj_ids[] = $tree_data['obj_id'];
148  }
149  if (!count($obj_ids)) {
150  return false;
151  }
152  $query = "SELECT event_id FROM event_appointment " .
153  "WHERE e_start < " . $ilDB->now() . " " .
154  "AND " . $ilDB->in('event_id', $obj_ids, false, 'integer') . " " .
155  "ORDER BY e_start DESC ";
156  $ilDB->setLimit(1, 0);
157  $res = $ilDB->query($query);
158  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
159  $event_id = (int) $row->event_id;
160  }
161  return $event_id ?? 0;
162  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupNextSessionByCourse()

static ilSessionAppointment::lookupNextSessionByCourse ( int  $a_ref_id)
static
Returns
array|bool

Definition at line 82 of file class.ilSessionAppointment.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilTree\getChildsByType(), IL_CAL_DATE, IL_CAL_DAY, and IL_CAL_UNIX.

Referenced by ilContainerSimpleContentGUI\initDetails(), ilContainerByTypeContentGUI\initDetails(), and ilContainerSessionsContentGUI\initDetails().

83  {
84  global $DIC;
85 
86  $tree = $DIC->repositoryTree();
87  $ilDB = $DIC->database();
88 
89 
90  $sessions = $tree->getChildsByType($a_ref_id, 'sess');
91  $obj_ids = [];
92  foreach ($sessions as $tree_data) {
93  $obj_ids[] = $tree_data['obj_id'];
94  }
95  if (!count($obj_ids)) {
96  return false;
97  }
98 
99  // Try to read the next sessions within the next 24 hours
100  $now = new ilDate(time(), IL_CAL_UNIX);
101  $tomorrow = clone $now;
102  $tomorrow->increment(IL_CAL_DAY, 2);
103 
104  $query = "SELECT event_id FROM event_appointment " .
105  "WHERE e_start > " . $ilDB->quote($now->get(IL_CAL_DATE), 'timestamp') . ' ' .
106  "AND e_start < " . $ilDB->quote($tomorrow->get(IL_CAL_DATE), 'timestamp') . ' ' .
107  "AND " . $ilDB->in('event_id', $obj_ids, false, 'integer') . ' ' .
108  "ORDER BY e_start ";
109 
110  $event_ids = [];
111 
112  $res = $ilDB->query($query);
113  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
114  $event_ids[] = $row->event_id;
115  }
116 
117  if (count($event_ids)) {
118  return $event_ids;
119  }
120 
121  // Alternativ: get next event.
122  $query = "SELECT event_id FROM event_appointment " .
123  "WHERE e_start > " . $ilDB->now() . " " .
124  "AND " . $ilDB->in('event_id', $obj_ids, false, 'integer') . " " .
125  "ORDER BY e_start ";
126  $ilDB->setLimit(1, 0);
127  $res = $ilDB->query($query);
128  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
129  $event_id = $row->event_id;
130  }
131  return isset($event_id) ? [$event_id] : [];
132  }
$res
Definition: ltiservices.php:69
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
const IL_CAL_DAY
$query
const IL_CAL_DATE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAppointmentId()

ilSessionAppointment::setAppointmentId ( int  $a_appointment_id)

Definition at line 189 of file class.ilSessionAppointment.php.

189  : void
190  {
191  $this->appointment_id = $a_appointment_id;
192  }

◆ setEnd()

ilSessionAppointment::setEnd ( ilDateTime  $a_end)

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

184  : void
185  {
186  $this->end = $a_end;
187  }

◆ setEndingTime()

ilSessionAppointment::setEndingTime ( int  $a_ending_time)

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

References IL_CAL_UNIX.

219  : void
220  {
221  $this->ending_time = $a_ending_time;
222  $this->end = new ilDateTime($this->ending_time, IL_CAL_UNIX);
223  }
const IL_CAL_UNIX

◆ setSessionId()

ilSessionAppointment::setSessionId ( int  $a_session_id)

Definition at line 199 of file class.ilSessionAppointment.php.

Referenced by __read().

199  : void
200  {
201  $this->session_id = $a_session_id;
202  }
+ Here is the caller graph for this function:

◆ setStart()

ilSessionAppointment::setStart ( ilDateTime  $a_start)

Definition at line 174 of file class.ilSessionAppointment.php.

174  : void
175  {
176  $this->start = $a_start;
177  }

◆ setStartingTime()

ilSessionAppointment::setStartingTime ( int  $a_starting_time)

Definition at line 208 of file class.ilSessionAppointment.php.

References IL_CAL_UNIX.

208  : void
209  {
210  $this->starting_time = $a_starting_time;
211  $this->start = new ilDateTime($this->starting_time, IL_CAL_UNIX);
212  }
const IL_CAL_UNIX

◆ timeToString()

ilSessionAppointment::timeToString ( int  $start,
int  $end 
)

Definition at line 243 of file class.ilSessionAppointment.php.

References $end, $lng, $start, and ilLanguage\txt().

Referenced by formatTime().

243  : string
244  {
245  $lng = $this->lng;
246 
247  $start = date($lng->txt('lang_timeformat_no_sec'), $start);
248  $end = date($lng->txt('lang_timeformat_no_sec'), $end);
249 
250  return $start . ' - ' . $end;
251  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggleFullTime()

ilSessionAppointment::toggleFullTime ( bool  $a_status)

Definition at line 229 of file class.ilSessionAppointment.php.

Referenced by __read().

229  : void
230  {
231  $this->fulltime = $a_status;
232  }
+ Here is the caller graph for this function:

◆ update()

ilSessionAppointment::update ( )

Definition at line 312 of file class.ilSessionAppointment.php.

References $db, $ilDB, $query, $res, enabledFullTime(), getAppointmentId(), getEnd(), getSessionId(), getStart(), and IL_CAL_DATETIME.

312  : bool
313  {
314  $ilDB = $this->db;
315 
316  if (!$this->getSessionId()) {
317  return false;
318  }
319  $query = "UPDATE event_appointment " .
320  "SET event_id = " . $ilDB->quote($this->getSessionId(), 'integer') . ", " .
321  "e_start = " . $ilDB->quote($this->getStart()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
322  "e_end = " . $ilDB->quote($this->getEnd()->get(IL_CAL_DATETIME, '', 'UTC'), 'timestamp') . ", " .
323  "fulltime = " . $ilDB->quote((int) $this->enabledFullTime(), 'integer') . " " .
324  "WHERE appointment_id = " . $ilDB->quote($this->getAppointmentId(), 'integer') . " ";
325  $res = $ilDB->manipulate($query);
326 
327  return true;
328  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
getStart()
Get start of date period.
$query
+ Here is the call graph for this function:

◆ validate()

ilSessionAppointment::validate ( )

Definition at line 379 of file class.ilSessionAppointment.php.

References ILIAS\Repository\lng().

379  : bool
380  {
381  if ($this->starting_time > $this->ending_time) {
382  $this->ilErr->appendMessage($this->lng->txt('event_etime_smaller_stime'));
383  return false;
384  }
385  return true;
386  }
+ Here is the call graph for this function:

Field Documentation

◆ $appointment_id

int ilSessionAppointment::$appointment_id = 0
protected

Definition at line 41 of file class.ilSessionAppointment.php.

Referenced by getAppointmentId().

◆ $db

ilDBInterface ilSessionAppointment::$db
protected

Definition at line 33 of file class.ilSessionAppointment.php.

Referenced by __read(), create(), and update().

◆ $end

ilDateTime ilSessionAppointment::$end = null
protected

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

Referenced by timeToString().

◆ $ending_time

int ilSessionAppointment::$ending_time = 0
protected

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

◆ $fulltime

bool ilSessionAppointment::$fulltime = false
protected

Definition at line 40 of file class.ilSessionAppointment.php.

Referenced by enabledFullTime().

◆ $ilErr

ilErrorHandling ilSessionAppointment::$ilErr
protected

Definition at line 32 of file class.ilSessionAppointment.php.

◆ $lng

ilLanguage ilSessionAppointment::$lng
protected

Definition at line 35 of file class.ilSessionAppointment.php.

Referenced by timeToString().

◆ $session_id

int ilSessionAppointment::$session_id = 0
protected

Definition at line 42 of file class.ilSessionAppointment.php.

Referenced by getSessionId().

◆ $start

ilDateTime ilSessionAppointment::$start = null
protected

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

Referenced by timeToString().

◆ $starting_time

int ilSessionAppointment::$starting_time = 0
protected

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

◆ $tree

ilTree ilSessionAppointment::$tree
protected

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


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