34require_once 
"./Services/Object/classes/class.ilObject.php";
 
   49    public function __construct($a_id, $a_call_by_reference = 
true)
 
   53        $this->db = 
$DIC->database();
 
   54        $this->
user = $DIC->user();
 
   66    public function delete()
 
   72        if (!parent::delete()) {
 
   88    public function getHeaderTitleTranslations()
 
   95        $q = 
"SELECT * FROM object_translation WHERE obj_id = " .
 
   96            $ilDB->quote($this->
getId(), 
'integer') . 
" ORDER BY lang_default DESC";
 
   97        $r = 
$ilDB->query($q);
 
  101        while ($row = 
$ilDB->fetchObject($r)) {
 
  102            $data[
"Fobject"][$num] = array(
"title" => $row->title,
 
  104                                          "lang" => $row->lang_code
 
  110        $data[
"default_language"] = 0;
 
  120        $query = 
"DELETE FROM object_translation WHERE obj_id= " .
 
  130        $query = 
"INSERT INTO object_translation " .
 
  131             "(obj_id,title,description,lang_code,lang_default) " .
 
  133             "(" . 
$ilDB->quote($this->
getId(), 
'integer') . 
"," .
 
  134             $ilDB->quote($a_title, 
'text') . 
"," .
 
  135             $ilDB->quote($a_desc, 
'text') . 
"," .
 
  136             $ilDB->quote($a_lang, 
'text') . 
"," .
 
  137             $ilDB->quote($a_lang_default, 
'integer') . 
")";
 
  143    public static function _getId()
 
  152        $q = 
"SELECT obj_id FROM object_data WHERE type = " . 
$ilDB->quote(
'adm', 
'text');
 
  153        $r = 
$ilDB->query($q);
 
  154        $row = 
$ilDB->fetchObject($r);
 
  159    public static function _getHeaderTitle() : string
 
  170        $id = ilObjSystemFolder::_getId();
 
  174        $q = 
"SELECT title FROM object_translation " .
 
  175            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  176            "AND lang_default = 1";
 
  177        $r = 
$ilDB->query($q);
 
  178        $row = 
$ilDB->fetchObject($r);
 
  180            $title = (string) $row->title;
 
  183        $q = 
"SELECT title FROM object_translation " .
 
  184            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  186            $ilDB->quote(
$ilUser->getCurrentLanguage(), 
'text') . 
" " .
 
  187            "AND NOT lang_default = 1";
 
  188        $r = 
$ilDB->query($q);
 
  189        $row = 
$ilDB->fetchObject($r);
 
  192            $title = (string) $row->title;
 
  203        $id = ilObjSystemFolder::_getId();
 
  205        $q = 
"SELECT title,description FROM object_translation " .
 
  206            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  207            "AND lang_default = 1";
 
  208        $r = 
$ilDB->query($q);
 
  209        $row = 
$ilDB->fetchObject($r);
 
  210        $description = $row->description;
 
  212        $q = 
"SELECT title,description FROM object_translation " .
 
  213            "WHERE obj_id = " . 
$ilDB->quote(
$id, 
'integer') . 
" " .
 
  215            $ilDB->quote(
$ilUser->getPref(
"language"), 
'text') . 
" " .
 
  216            "AND NOT lang_default = 1";
 
  217        $r = 
$ilDB->query($q);
 
  218        $row = 
$ilDB->fetchObject($r);
 
An exception for terminatinating execution or to throw for unit testing.
_getHeaderTitleDescription()
__construct($a_id, $a_call_by_reference=true)
Constructor @access public.
removeHeaderTitleTranslations()
addHeaderTitleTranslation($a_title, $a_desc, $a_lang, $a_lang_default)
Class ilObject Basic functions for all objects.
getId()
get object id @access public
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res