ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCalendarRecurrenceExclusion Class Reference

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

+ Collaboration diagram for ilCalendarRecurrenceExclusion:

Public Member Functions

 __construct (int $a_exclusion_id=0)
 
 getId ()
 
 getEntryId ()
 
 setEntryId (int $a_id)
 
 getDate ()
 
 setDate (?ilDate $dt=null)
 Set exclusion date. More...
 
 toICal ()
 
 save ()
 

Protected Member Functions

 read ()
 

Protected Attributes

ilDate $exclusion = null
 
int $cal_id = 0
 
int $exclusion_id = 0
 
ilDBInterface $db
 

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 Stores exclusion dates for calendar recurrences

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

Definition at line 23 of file class.ilCalendarRecurrenceExclusion.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarRecurrenceExclusion::__construct ( int  $a_exclusion_id = 0)

Definition at line 31 of file class.ilCalendarRecurrenceExclusion.php.

References $DIC, getId(), and read().

32  {
33  global $DIC;
34 
35  $this->db = $DIC->database();
36  $this->exclusion_id = $a_exclusion_id;
37  if ($this->getId()) {
38  $this->read();
39  }
40  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getDate()

ilCalendarRecurrenceExclusion::getDate ( )

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

References null.

Referenced by save(), and toICal().

57  : ?ilDate
58  {
59  return $this->exclusion instanceof ilDate ? $this->exclusion : null;
60  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getEntryId()

ilCalendarRecurrenceExclusion::getEntryId ( )

Definition at line 47 of file class.ilCalendarRecurrenceExclusion.php.

References $cal_id.

Referenced by toICal().

47  : int
48  {
49  return $this->cal_id;
50  }
+ Here is the caller graph for this function:

◆ getId()

ilCalendarRecurrenceExclusion::getId ( )

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

References $exclusion_id.

Referenced by __construct(), read(), and save().

+ Here is the caller graph for this function:

◆ read()

ilCalendarRecurrenceExclusion::read ( )
protected

Definition at line 102 of file class.ilCalendarRecurrenceExclusion.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, getId(), IL_CAL_DATE, and setDate().

Referenced by __construct().

103  {
104  $query = "SELECT * FROM cal_rec_exclusion WHERE excl_id = " . $this->db->quote($this->getId(), 'integer');
105  $res = $this->db->query($query);
106  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
107  $this->cal_id = $row->cal_id;
108  $this->setDate(new ilDate((string) $row->excl_date, IL_CAL_DATE));
109  }
110  }
$res
Definition: ltiservices.php:66
setDate(?ilDate $dt=null)
Set exclusion date.
const IL_CAL_DATE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilCalendarRecurrenceExclusion::save ( )

Definition at line 84 of file class.ilCalendarRecurrenceExclusion.php.

References getDate(), getId(), and IL_CAL_DATE.

84  : int
85  {
86  if (!$this->getDate()) {
87  return 0;
88  }
89 
90  $query = "INSERT INTO cal_rec_exclusion (excl_id,cal_id,excl_date) " .
91  "VALUES( " .
92  $this->db->quote($next_id = $this->db->nextId('cal_rec_exclusion'), 'integer') . ', ' .
93  $this->db->quote($this->getEntryId(), 'integer') . ', ' .
94  $this->db->quote($this->getDate()->get(IL_CAL_DATE, '', 'UTC'), 'timestamp') .
95  ')';
96  $this->db->manipulate($query);
97 
98  $this->exclusion_id = $next_id;
99  return $this->getId();
100  }
const IL_CAL_DATE
+ Here is the call graph for this function:

◆ setDate()

ilCalendarRecurrenceExclusion::setDate ( ?ilDate  $dt = null)

Set exclusion date.

Definition at line 65 of file class.ilCalendarRecurrenceExclusion.php.

Referenced by read().

65  : void
66  {
67  $this->exclusion = $dt;
68  }
+ Here is the caller graph for this function:

◆ setEntryId()

ilCalendarRecurrenceExclusion::setEntryId ( int  $a_id)

Definition at line 52 of file class.ilCalendarRecurrenceExclusion.php.

53  {
54  $this->cal_id = $a_id;
55  }

◆ toICal()

ilCalendarRecurrenceExclusion::toICal ( )

Definition at line 70 of file class.ilCalendarRecurrenceExclusion.php.

References getDate(), getEntryId(), IL_CAL_FKT_DATE, and ilTimeZone\UTC.

70  : string
71  {
72  $entry = new ilCalendarEntry($this->getEntryId());
73  $start = $entry->getStart();
74 
75  if ($entry->isFullday()) {
76  return 'EXDATE;VALUE=DATE:' . $this->getDate()->get(IL_CAL_FKT_DATE, 'Ymd');
77  } else {
78  return 'EXDATE:' .
79  $this->getDate()->get(IL_CAL_FKT_DATE, 'Ymd', ilTimeZone::UTC) .
80  'T' . $start->get(IL_CAL_FKT_DATE, 'His', ilTimeZone::UTC) . 'Z';
81  }
82  }
const IL_CAL_FKT_DATE
+ Here is the call graph for this function:

Field Documentation

◆ $cal_id

int ilCalendarRecurrenceExclusion::$cal_id = 0
protected

Definition at line 26 of file class.ilCalendarRecurrenceExclusion.php.

Referenced by getEntryId().

◆ $db

ilDBInterface ilCalendarRecurrenceExclusion::$db
protected

Definition at line 29 of file class.ilCalendarRecurrenceExclusion.php.

◆ $exclusion

ilDate ilCalendarRecurrenceExclusion::$exclusion = null
protected

Definition at line 25 of file class.ilCalendarRecurrenceExclusion.php.

◆ $exclusion_id

int ilCalendarRecurrenceExclusion::$exclusion_id = 0
protected

Definition at line 27 of file class.ilCalendarRecurrenceExclusion.php.

Referenced by getId().


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