48        $this->link_type = 
"extern";
 
   49        $this->link_ref_id = 
null;
 
   54        $this->lm_id = $a_obj_id;
 
   64        $this->entry_id = $a_id;
 
   69        return $this->entry_id;
 
   74        $this->link_type = $a_link_type;
 
   79        return $this->link_type;
 
   84        $this->title = $a_title;
 
   94        $this->target = $a_target;
 
  104        $this->link_ref_id = $a_link_ref_id;
 
  109        return $this->link_ref_id;
 
  119        $this->active = $a_val;
 
  137        $id = 
$ilDB->nextId(
"lm_menu");
 
  138        $q = 
"INSERT INTO lm_menu (id, lm_id,link_type,title,target,link_ref_id, active) " .
 
  141             $ilDB->quote($id, 
"integer") . 
"," .
 
  149        $r = 
$ilDB->manipulate($q);
 
  151        $this->entry_id = $id;
 
  162        if ($a_only_active === 
true) {
 
  163            $and = 
" AND active = " . 
$ilDB->quote(
"y", 
"text");
 
  166        $q = 
"SELECT * FROM lm_menu " .
 
  167             "WHERE lm_id = " . 
$ilDB->quote($this->lm_id, 
"integer") .
 
  170        $r = 
$ilDB->query($q);
 
  172        while ($row = 
$ilDB->fetchObject($r)) {
 
  173            $entries[] = array(
'id' => $row->id,
 
  174                               'title' => $row->title,
 
  175                               'link' => $row->target,
 
  176                               'type' => $row->link_type,
 
  177                               'ref_id' => $row->link_ref_id,
 
  178                               'active' => $row->active
 
  189    public function delete($a_id)
 
  197        $q = 
"DELETE FROM lm_menu WHERE id = " .
 
  198            $ilDB->quote($a_id, 
"integer");
 
  199        $ilDB->manipulate($q);
 
  212        $q = 
"UPDATE lm_menu SET " .
 
  214            " title = " . 
$ilDB->quote($this->
getTitle(), 
"text") . 
"," .
 
  218        $r = 
$ilDB->manipulate($q);
 
  231        $q = 
"SELECT * FROM lm_menu WHERE id = " .
 
  232            $ilDB->quote($a_id, 
"integer");
 
  233        $r = 
$ilDB->query($q);
 
  235        $row = 
$ilDB->fetchObject($r);
 
  241        $this->setEntryid($a_id);
 
  255        $q = 
"UPDATE lm_menu SET " .
 
  257             "WHEN " . 
$ilDB->in(
"id", $a_entries, 
false, 
"integer") . 
" " .
 
  258             "THEN " . 
$ilDB->quote(
"y", 
"text") . 
" " .
 
  259             "ELSE " . 
$ilDB->quote(
"n", 
"text") . 
" " .
 
  261             "WHERE lm_id = " . 
$ilDB->quote($this->lm_id, 
"integer");
 
  263        $ilDB->manipulate($q);
 
  279            "SELECT * FROM lm_menu " .
 
  280            " WHERE lm_id = %s ",
 
  284        while ($rec = 
$db->fetchAssoc($set)) {
 
  286            if ($rec[
"link_type"] == 
"intern") {
 
  287                $link = explode(
"_", $rec[
"link_ref_id"]);
 
  288                $ref_id = (int) $link[count($link) - 1];
 
  289                $new_ref_id = $ref_mapping[$ref_id];
 
  291                if ($new_ref_id > 0) {
 
  292                    $new_target = str_replace((
string) $ref_id, (
string) $new_ref_id, $rec[
"target"]);
 
  293                    $db->update(
"lm_menu", array(
 
  294                            "link_ref_id" => array(
"integer", $new_ref_id),
 
  295                            "target" => array(
"text", $new_target)
 
  297                            "id" => array(
"integer", $rec[
"id"])
 
  301                        "DELETE FROM lm_menu WHERE " .
 
  323        $db->update(
"lm_menu", array(
 
  324                "active" => array(
"text", (
$active ? 
"y" : 
"n"))
 
  326                "id" => array(
"", $entry_id)
 
An exception for terminatinating execution or to throw for unit testing.