37        $this->db = 
$DIC->database();
 
   48        $this->
id = (int) $a_value;
 
   68        $this->parent_id = (int) $a_value;
 
   88        $this->title = (string) $a_value;
 
  108        $this->description = (string) $a_value;
 
  128        $this->pos = (int) $a_value;
 
  152            $sql = 
"SELECT * FROM il_rating_cat" .
 
  153                " WHERE id = " . 
$ilDB->quote($a_id, 
"integer");
 
  154            $set = 
$ilDB->query($sql);
 
  155            $row = 
$ilDB->fetchAssoc($set);
 
  157                $this->
setId($row[
"id"]);
 
  174        $fields = array(
"title" => array(
"text", $this->
getTitle()),
 
  188        if ($this->
getId()) {
 
  194                array(
"id" => array(
"integer", $this->
getId()))
 
  206        $id = 
$ilDB->nextId(
"il_rating_cat");
 
  210        $sql = 
"SELECT max(pos) pos FROM il_rating_cat" .
 
  212        $set = 
$ilDB->query($sql);
 
  218        $fields[
"id"] = array(
"integer", 
$id);
 
  219        $fields[
"parent_id"] = array(
"integer", $this->
getParentId());
 
  221        $ilDB->insert(
"il_rating_cat", $fields);
 
  229    public static function delete($a_id)
 
  236            $sql = 
"DELETE FROM il_rating" .
 
  237                " WHERE category_id = " . 
$ilDB->quote($a_id, 
"integer");
 
  238            $ilDB->manipulate($sql);
 
  240            $sql = 
"DELETE FROM il_rating_cat" .
 
  241                " WHERE id = " . 
$ilDB->quote($a_id, 
"integer");
 
  242            $ilDB->manipulate($sql);
 
  260        $sql = 
"SELECT * FROM il_rating_cat" .
 
  261            " WHERE parent_id = " . 
$ilDB->quote($a_parent_obj_id, 
"integer") .
 
  263        $set = 
$ilDB->query($sql);
 
  264        while ($row = 
$ilDB->fetchAssoc($set)) {
 
  278        if ((
int) $a_parent_obj_id) {
 
  279            foreach (self::getAllForObject($a_parent_obj_id) as $item) {
 
An exception for terminatinating execution or to throw for unit testing.
setPosition($a_value)
Set position.
setTitle($a_value)
Set title.
read($a_id)
Load db entry.
static delete($a_id)
Delete db entry.
setParentId($a_value)
Set parent id.
getPosition()
Get position.
getParentId()
Get parent object id.
getDescription()
Get description.
getDBProperties()
Parse properties into db definition.
setDescription($a_value)
Set description.
__construct($a_id=null)
Constructor.
static deleteForObject($a_parent_obj_id)
Delete all categories for object.
static getAllForObject($a_parent_obj_id)
Get all categories for object.