ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjNotificationAdmin.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
25 {
26  protected int $root_ref_id = 0;
27  protected int $root_id = 0;
28 
32  public function __construct($a_id = 0, $a_call_by_reference = true)
33  {
34  $this->type = 'nota';
35  parent::__construct($a_id, $a_call_by_reference);
36  }
37 
41  public function delete(): bool
42  {
43  return false;
44  }
45 
46  public function getRootRefId(): int
47  {
48  $this->loadRootRefIdAndId();
49 
50  return $this->root_ref_id;
51  }
52 
53  public function getRootId(): int
54  {
55  $this->loadRootRefIdAndId();
56 
57  return $this->root_id;
58  }
59 
63  private function loadRootRefIdAndId(): void
64  {
65  if ($this->root_ref_id === 0 || $this->root_id === 0) {
66  $q = "SELECT object_reference.obj_id, object_reference.ref_id FROM object_data
67  INNER JOIN object_reference ON object_reference.obj_id = object_data.obj_id
68  WHERE type = %s";
69  $set = $this->db->queryF($q, ['text'], ['nota']);
70  if ($res = $this->db->fetchAssoc($set)) {
71  $this->root_id = (int) $res["obj_id"];
72  $this->root_ref_id = (int) $res["ref_id"];
73  } else {
74  throw new PDOException('Node "nota" not found.');
75  }
76  }
77  }
78 }
$res
Definition: ltiservices.php:69
__construct($a_id=0, $a_call_by_reference=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)