40 $this->
id = (int)$a_value;
60 $this->parent_id = (int)$a_value;
80 $this->title = (string)$a_value;
100 $this->description = (string)$a_value;
120 $this->pos = (int)$a_value;
145 $sql =
"SELECT * FROM il_rating_cat".
146 " WHERE id = ".$ilDB->quote($a_id,
"integer");
147 $set = $ilDB->query($sql);
148 $row = $ilDB->fetchAssoc($set);
168 $fields = array(
"title" => array(
"text", $this->
getTitle()),
186 $ilDB->update(
"il_rating_cat", $fields,
187 array(
"id" => array(
"integer", $this->
getId())));
198 $id = $ilDB->nextId(
"il_rating_cat");
202 $sql =
"SELECT max(pos) pos FROM il_rating_cat".
203 " WHERE parent_id = ".$ilDB->quote($this->
getParentId(),
"integer");
204 $set = $ilDB->query($sql);
205 $pos = $ilDB->fetchAssoc($set);
210 $fields[
"id"] = array(
"integer",
$id);
211 $fields[
"parent_id"] = array(
"integer", $this->
getParentId());
213 $ilDB->insert(
"il_rating_cat", $fields);
221 public static function delete($a_id)
227 $sql =
"DELETE FROM il_rating".
228 " WHERE category_id = ".$ilDB->quote($a_id,
"integer");
229 $ilDB->manipulate($sql);
231 $sql =
"DELETE FROM il_rating_cat".
232 " WHERE id = ".$ilDB->quote($a_id,
"integer");
233 $ilDB->manipulate($sql);
249 $sql =
"SELECT * FROM il_rating_cat".
250 " WHERE parent_id = ".$ilDB->quote($a_parent_obj_id,
"integer").
252 $set = $ilDB->query($sql);
253 while(
$row = $ilDB->fetchAssoc($set))
268 if((
int)$a_parent_obj_id)
270 foreach(self::getAllForObject($a_parent_obj_id) as $item)