50 $this->cal_entry_id = $a_cal_entry_id;
67 $query =
"SELECT cat_id FROM cal_cat_assignments ".
68 "WHERE cal_id = ".$ilDB->quote($a_cal_id ,
'integer').
" ";
72 $cat_ids[] =
$row->cat_id;
74 return $cat_ids ? $cat_ids : array();
87 if(count($cats = self::_lookupCategories($a_cal_id)))
105 $query =
"SELECT * FROM cal_cat_assignments ".
106 "WHERE ".$ilDB->in(
'cal_id',$a_cal_ids,
false,
'integer');
112 return $map ? $map : array();
126 $query =
"SELECT * FROM cal_cat_assignments ".
127 "WHERE ".$ilDB->in(
'cat_id',$a_cat_id,
false,
'integer');
132 $cal_ids[] =
$row->cal_id;
134 return $cal_ids ? $cal_ids : array();
149 $query =
"SELECT ce.cal_id FROM cal_categories cc ".
150 "JOIN cal_cat_assignments cca ON cc.cat_id = cca.cat_id ".
151 "JOIN cal_entries ce ON cca.cal_id = ce.cal_id ".
152 "WHERE auto_generated = 1 ".
153 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
157 $apps[] =
$row->cal_id;
159 return $apps ? $apps : array();
173 $query =
"DELETE FROM cal_cat_assignments ".
174 "WHERE cal_id = ".$ilDB->quote($a_app_id ,
'integer').
" ";
192 $query =
"DELETE FROM cal_cat_assignments ".
193 "WHERE cat_id = ".$ilDB->quote($a_cat_id ,
'integer').
" ";
206 return isset($this->assignments[0]) ? $this->assignments[0] :
false;
217 return $this->assignments ? $this->assignments : array();
231 $query =
"INSERT INTO cal_cat_assignments (cal_id,cat_id) ".
233 $this->db->quote($this->cal_entry_id ,
'integer').
", ".
234 $this->db->quote($a_cal_cat_id ,
'integer').
" ".
237 $this->assignments[] = (int) $a_cal_cat_id;
253 $query =
"DELETE FROM cal_cat_assignments ".
254 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
", ".
255 "AND cat_id = ".$this->db->quote($a_cat_id ,
'integer').
" ";
258 if(($key = array_search($a_cat_id,$this->assignments)) !==
false)
260 unset($this->assignments[$key]);
274 $query =
"DELETE FROM cal_cat_assignments ".
275 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
" ";
291 $query =
"SELECT * FROM cal_cat_assignments ".
292 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
" ";
297 $this->assignments[] =
$row->cat_id;