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();
145 $query =
'SELECT COUNT(*) num FROM cal_cat_assignments '.
146 'WHERE '.$ilDB->in(
'cat_id', $a_cat_ids,
false,
'integer');
167 $query =
"SELECT ce.cal_id FROM cal_categories cc ".
168 "JOIN cal_cat_assignments cca ON cc.cat_id = cca.cat_id ".
169 "JOIN cal_entries ce ON cca.cal_id = ce.cal_id ".
170 "WHERE auto_generated = 1 ".
171 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
175 $apps[] =
$row->cal_id;
177 return $apps ? $apps : array();
191 $query =
"DELETE FROM cal_cat_assignments ".
192 "WHERE cal_id = ".$ilDB->quote($a_app_id ,
'integer').
" ";
210 $query =
"DELETE FROM cal_cat_assignments ".
211 "WHERE cat_id = ".$ilDB->quote($a_cat_id ,
'integer').
" ";
224 return isset($this->assignments[0]) ? $this->assignments[0] :
false;
235 return $this->assignments ? $this->assignments : array();
249 $query =
"INSERT INTO cal_cat_assignments (cal_id,cat_id) ".
251 $this->db->quote($this->cal_entry_id ,
'integer').
", ".
252 $this->db->quote($a_cal_cat_id ,
'integer').
" ".
255 $this->assignments[] = (int) $a_cal_cat_id;
271 $query =
"DELETE FROM cal_cat_assignments ".
272 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
", ".
273 "AND cat_id = ".$this->db->quote($a_cat_id ,
'integer').
" ";
276 if(($key = array_search($a_cat_id,$this->assignments)) !==
false)
278 unset($this->assignments[$key]);
292 $query =
"DELETE FROM cal_cat_assignments ".
293 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
" ";
309 $query =
"SELECT * FROM cal_cat_assignments ".
310 "WHERE cal_id = ".$this->db->quote($this->cal_entry_id ,
'integer').
" ";
315 $this->assignments[] =
$row->cat_id;