ILIAS  Release_4_4_x_branch Revision 61816
 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 38 of file class.ilCalendarRecurrenceExclusion.php.

Constructor & Destructor Documentation

ilCalendarRecurrenceExclusion::__construct (   $a_exclusion_id = 0)

Constructor.

Returns

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

References 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 96 of file class.ilCalendarRecurrenceExclusion.php.

Referenced by save(), and toICal().

{
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 77 of file class.ilCalendarRecurrenceExclusion.php.

References $cal_id.

Referenced by toICal().

{
return $this->cal_id;
}

+ Here is the caller graph for this function:

ilCalendarRecurrenceExclusion::getId ( )

Get exclusion id.

Returns

Definition at line 68 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 161 of file class.ilCalendarRecurrenceExclusion.php.

References $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 136 of file class.ilCalendarRecurrenceExclusion.php.

References $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 106 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 87 of file class.ilCalendarRecurrenceExclusion.php.

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

Exclusion date to ical format.

Returns

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

References getDate(), getEntryId(), and IL_CAL_FKT_DATE.

{
$entry = new ilCalendarEntry($this->getEntryId());
$start = $entry->getStart();
if($entry->isFullday())
{
return 'EXDATE;VALUE=DATE:'.$this->getDate()->get(IL_CAL_FKT_DATE,'Ymd');
}
else
{
return 'EXDATE:'.
$this->getDate()->get(IL_CAL_FKT_DATE, 'Ymd').
'T'.$start->get(IL_CAL_FKT_DATE,'his');
}
}

+ Here is the call graph for this function:

Field Documentation

ilCalendarRecurrenceExclusion::$cal_id = 0
protected

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

Referenced by getEntryId().

ilCalendarRecurrenceExclusion::$db = null
protected

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

ilCalendarRecurrenceExclusion::$exclusion = null
protected

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

ilCalendarRecurrenceExclusion::$exclusion_id = 0
protected

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

Referenced by getId().


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