Public Member Functions | |
ilObjCategory ($a_id=0, $a_call_by_reference=true) | |
Constructor public. | |
ilClone ($a_parent_ref) | |
copy all properties and subobjects of a category. | |
delete () | |
delete category and all related data | |
getTranslations () | |
get all translations from this category | |
removeTranslations () | |
addTranslation ($a_title, $a_desc, $a_lang, $a_lang_default) |
Definition at line 37 of file class.ilObjCategory.php.
ilObjCategory::addTranslation | ( | $ | a_title, | |
$ | a_desc, | |||
$ | a_lang, | |||
$ | a_lang_default | |||
) |
Definition at line 132 of file class.ilObjCategory.php.
References $q, and ilUtil::prepareDBString().
{ if (empty($a_title)) { $a_title = "NO TITLE"; } $q = "INSERT INTO object_translation ". "(obj_id,title,description,lang_code,lang_default) ". "VALUES ". "(".$this->getId().",'".ilUtil::prepareDBString($a_title)."','".ilUtil::prepareDBString($a_desc)."','".$a_lang."',".$a_lang_default.")"; $this->ilias->db->query($q); return true; }
ilObjCategory::delete | ( | ) |
delete category and all related data
public
Reimplemented from ilObject.
Definition at line 82 of file class.ilObjCategory.php.
References $query.
ilObjCategory::getTranslations | ( | ) |
get all translations from this category
public
Definition at line 102 of file class.ilObjCategory.php.
References $data, $q, and $row.
{ $q = "SELECT * FROM object_translation WHERE obj_id = ".$this->getId()." ORDER BY lang_default DESC"; $r = $this->ilias->db->query($q); $num = 0; while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT)) { $data["Fobject"][$num]= array("title" => $row->title, "desc" => $row->description, "lang" => $row->lang_code ); $num++; } // first entry is always the default language $data["default_language"] = 0; return $data ? $data : array(); }
ilObjCategory::ilClone | ( | $ | a_parent_ref | ) |
copy all properties and subobjects of a category.
public
Reimplemented from ilObject.
Definition at line 63 of file class.ilObjCategory.php.
References $rbacadmin.
{ global $rbacadmin; // always call parent clone function first!! $new_ref_id = parent::ilClone($a_parent_ref); // put here cat specific stuff // ... and finally always return new reference ID!! return $new_ref_id; }
ilObjCategory::ilObjCategory | ( | $ | a_id = 0 , |
|
$ | a_call_by_reference = true | |||
) |
Constructor public.
integer | reference_id or object_id | |
boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 45 of file class.ilObjCategory.php.
References $ilBench.
{ global $ilBench; $ilBench->start("Core", "ilObjCategory_Constructor"); $this->type = "cat"; $this->ilContainer($a_id,$a_call_by_reference); $ilBench->stop("Core", "ilObjCategory_Constructor"); }
ilObjCategory::removeTranslations | ( | ) |
Definition at line 125 of file class.ilObjCategory.php.
References $q.