65 $this->cat_id = $a_cat_id;
81 $query =
"SELECT cat_id FROM cal_categories ".
82 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
83 "AND type = ".$ilDB->quote(self::TYPE_OBJ ,
'integer');
99 if(!self::$instances[$a_cat_id])
103 return self::$instances[$a_cat_id];
116 $query =
"SELECT * FROM cal_cat_assignments ".
117 'WHERE cat_id = '.$ilDB->quote($a_category_id,
'integer');
121 $apps[] =
$row->cal_id;
123 return $apps ? $apps : array();
147 $this->title = $a_title;
170 $this->color = $a_color;
192 $this->type = $a_type;
214 $this->obj_id = $a_obj_id;
249 $next_id = $ilDB->nextId(
'cal_categories');
251 $query =
"INSERT INTO cal_categories (cat_id,obj_id,color,type,title) ".
253 $ilDB->quote($next_id,
'integer').
", ".
254 $this->db->quote($this->
getObjId() ,
'integer').
", ".
255 $this->db->quote($this->
getColor() ,
'text').
", ".
256 $this->db->quote($this->
getType() ,
'integer').
", ".
257 $this->db->quote($this->
getTitle() ,
'text').
" ".
261 $this->cat_id = $next_id;
275 $query =
"UPDATE cal_categories ".
276 "SET obj_id = ".$this->db->quote($this->
getObjId() ,
'integer').
", ".
277 "color = ".$this->db->quote($this->
getColor() ,
'text').
", ".
278 "type = ".$this->db->quote($this->
getType() ,
'integer').
", ".
279 "title = ".$this->db->quote($this->
getTitle() ,
'text').
" ".
280 "WHERE cat_id = ".$this->db->quote($this->cat_id ,
'integer').
" ";
291 public function delete()
295 $query =
"DELETE FROM cal_categories ".
296 "WHERE cat_id = ".$this->db->quote($this->cat_id ,
'integer').
" ";
299 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
302 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
305 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
336 $query =
"SELECT * FROM cal_categories ".
337 "WHERE cat_id = ".$this->db->quote($this->
getCategoryID() ,
'integer').
" ";
341 $this->cat_id =
$row->cat_id;
342 $this->obj_id =
$row->obj_id;
343 $this->type =
$row->type;
344 $this->color =
$row->color;
345 $this->title =
$row->title;