ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarRecurrenceExclusion Class Reference

Stores exclusion dates for calendar recurrences. More...

+ Collaboration diagram for ilCalendarRecurrenceExclusion:

Public Member Functions

 __construct ($a_exclusion_id=0)
 Constructor.
 getId ()
 Get exclusion id.
 getEntryId ()
 Get calendar entry id.
 setEntryId ($a_id)
 Set entry id (id of calendar appointment)
 getDate ()
 Get exclusion date.
 setDate (ilDate $dt=NULL)
 Set exclusion date.
 toICal ()
 Exclusion date to ical format.
 save ()
 Save exclusion date to db.

Protected Member Functions

 read ()
 Read exclusion.

Protected Attributes

 $exclusion = null
 $cal_id = 0
 $exclusion_id = 0
 $db = null

Detailed Description

Stores exclusion dates for calendar recurrences.

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

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

Constructor & Destructor Documentation

ilCalendarRecurrenceExclusion::__construct (   $a_exclusion_id = 0)

Constructor.

Returns

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

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

{
global $ilDB;
$this->db = $ilDB;
$this->exclusion_id = $a_exclusion_id;
if($this->getId())
{
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarRecurrenceExclusion::getDate ( )

Get exclusion date.

Returns

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

Referenced by save().

{
return $this->exclusion instanceof ilDate ? $this->exclusion : null;
}

+ Here is the caller graph for this function:

ilCalendarRecurrenceExclusion::getEntryId ( )

Get calendar entry id.

Returns

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

References $cal_id.

{
return $this->cal_id;
}
ilCalendarRecurrenceExclusion::getId ( )

Get exclusion id.

Returns

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

References $exclusion_id.

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

{
}

+ Here is the caller graph for this function:

ilCalendarRecurrenceExclusion::read ( )
protected

Read exclusion.

Returns

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getId(), IL_CAL_DATE, and setDate().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM cal_rec_exclusion WHERE excl_id = ".$ilDB->quote($this->getId(),'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->cal_id = $row->cal_id;
$this->setDate(new ilDate($row->excl_date,IL_CAL_DATE,'UTC'));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarRecurrenceExclusion::save ( )

Save exclusion date to db.

Returns

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

References $ilDB, $query, getDate(), getId(), and IL_CAL_DATE.

{
global $ilDB;
if(!$this->getDate())
{
return false;
}
$query = "INSERT INTO cal_rec_exclusion (excl_id,cal_id,excl_date) ".
"VALUES( ".
$ilDB->quote($next_id = $ilDB->nextId('cal_rec_exclusion'),'integer').', '.
$ilDB->quote($this->getEntryId(),'integer').', '.
$ilDB->quote($this->getDate()->get(IL_CAL_DATE,'','UTC'),'timestamp').
')';
$ilDB->manipulate($query);
$this->exclusion_id = $next_id;
return $this->getId();
}

+ Here is the call graph for this function:

ilCalendarRecurrenceExclusion::setDate ( ilDate  $dt = NULL)

Set exclusion date.

Parameters
ilDate$dt[optional]
Returns

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

Referenced by read().

{
$this->exclusion = $dt;
}

+ Here is the caller graph for this function:

ilCalendarRecurrenceExclusion::setEntryId (   $a_id)

Set entry id (id of calendar appointment)

Parameters
object$a_id
Returns

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

{
$this->cal_id = $a_id;
}
ilCalendarRecurrenceExclusion::toICal ( )

Exclusion date to ical format.

Returns

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

References IL_CAL_FKT_DATE.

{
return 'EXDATE:'.$this->getDate()->get(IL_CAL_FKT_DATE,'Ymd');
}

Field Documentation

ilCalendarRecurrenceExclusion::$cal_id = 0
protected

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

Referenced by getEntryId().

ilCalendarRecurrenceExclusion::$db = null
protected

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

ilCalendarRecurrenceExclusion::$exclusion = null
protected

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

ilCalendarRecurrenceExclusion::$exclusion_id = 0
protected

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

Referenced by getId().


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