49        0               => self::TYPE_GLOBAL,
 
   83        $this->cat_id = $a_cat_id;
 
   99        $query = 
"SELECT cat_id FROM cal_categories " .
 
  100            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" " .
 
  101            "AND type = " . 
$ilDB->quote(self::TYPE_OBJ, 
'integer');
 
  116        if (!self::$instances[$a_cat_id]) {
 
  119        return self::$instances[$a_cat_id];
 
  127        return array_search($a_type_id, self::$SORTED_TYPES);
 
  138        $query = 
"SELECT * FROM cal_cat_assignments " .
 
  139            'WHERE cat_id = ' . 
$ilDB->quote($a_category_id, 
'integer');
 
  142            $apps[] = 
$row->cal_id;
 
  144        return $apps ? $apps : array();
 
  168        $this->title = $a_title;
 
  191        $this->color = $a_color;
 
  235        $this->obj_id = $a_obj_id;
 
  271        $this->remote_url = $a_url;
 
  281        $this->remote_user = $a_user;
 
  291        $this->remote_pass = $a_pass;
 
  305        $this->remote_sync = $dt;
 
  314        if ($this->remote_sync instanceof 
ilDateTime) {
 
  331        $next_id = 
$ilDB->nextId(
'cal_categories');
 
  333        $query = 
"INSERT INTO cal_categories (cat_id,obj_id,color,type,title,loc_type,remote_url,remote_user,remote_pass,remote_sync) " .
 
  335            $ilDB->quote($next_id, 
'integer') . 
", " .
 
  336            $this->db->quote($this->
getObjId(), 
'integer') . 
", " .
 
  337            $this->db->quote($this->
getColor(), 
'text') . 
", " .
 
  338            $this->db->quote($this->
getType(), 
'integer') . 
", " .
 
  339            $this->db->quote($this->
getTitle(), 
'text') . 
", " .
 
  341            $this->db->quote($this->
getRemoteUrl(), 
'text') . 
', ' .
 
  347        $ilDB->manipulate(
$query);
 
  349        $this->cat_id = $next_id;
 
  363        $query = 
"UPDATE cal_categories " .
 
  364            "SET obj_id = " . $this->db->quote($this->
getObjId(), 
'integer') . 
", " .
 
  365            "color = " . $this->db->quote($this->
getColor(), 
'text') . 
", " .
 
  366            "type = " . $this->db->quote($this->
getType(), 
'integer') . 
", " .
 
  367            "title = " . $this->db->quote($this->
getTitle(), 
'text') . 
", " .
 
  368            "loc_type = " . $this->db->quote($this->
getLocationType(), 
'integer') . 
', ' .
 
  369            "remote_url = " . $this->db->quote($this->
getRemoteUrl(), 
'text') . 
', ' .
 
  370            "remote_user = " . $this->db->quote($this->
getRemoteUser(), 
'text') . 
', ' .
 
  371            "remote_pass = " . $this->db->quote($this->
getRemotePass(), 
'text') . 
', ' .
 
  373            "WHERE cat_id = " . $this->db->quote($this->cat_id, 
'integer') . 
" ";
 
  384    public function delete()
 
  388        $query = 
"DELETE FROM cal_categories " .
 
  389            "WHERE cat_id = " . $this->db->quote($this->cat_id, 
'integer') . 
" ";
 
  392        include_once(
'./Services/Calendar/classes/class.ilCalendarVisibility.php');
 
  395        include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
 
  397            include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
 
  429        if (!$this->cat_id) {
 
  433        $query = 
"SELECT * FROM cal_categories " .
 
  434            "WHERE cat_id = " . $this->db->quote($this->
getCategoryID(), 
'integer') . 
" ";
 
  437            $this->cat_id = 
$row->cat_id;
 
  438            $this->obj_id = 
$row->obj_id;
 
  439            $this->type = 
$row->type;
 
  440            $this->color = 
$row->color;
 
  441            $this->title = 
$row->title;
 
  442            $this->location = 
$row->loc_type;
 
  443            $this->remote_url = 
$row->remote_url;
 
  444            $this->remote_user = 
$row->remote_user;
 
  445            $this->remote_pass = 
$row->remote_pass;
 
  447            if (
$row->remote_sync) {
 
  453        if ($this->
getType() == self::TYPE_OBJ) {
 
An exception for terminatinating execution or to throw for unit testing.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
static _deleteByCategoryId($a_cat_id)
Delete assignments by category id.
Stores calendar categories.
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
__construct($a_cat_id=0)
Constructor.
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
setObjId($a_obj_id)
set obj id
setTitle($a_title)
set title
setRemoteSyncLastExecution(ilDateTime $dt=null)
Set remote sync last execution.
setColor($a_color)
set color
static lookupAppointments($a_category_id)
get all assigned appointment ids
getCategoryID()
get category id
static lookupCategorySortIndex($a_type_id)
Lookup sort index of calendar type.
getRemoteSyncLastExecution()
Get last execution date of remote sync.
static _delete($a_entry_id)
delete entry
static _deleteCategories($a_cat_id)
delete by category
@classDescription Date and time handling
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
foreach($_POST as $key=> $value) $res