ILIAS  release_8 Revision v8.24
class.ilObjTalkTemplate.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21final class ilObjTalkTemplate extends ilContainer
22{
23 public const TYPE = 'talt';
24
25 private static int $root_ref_id = -1;
26 private static int $root_id = -1;
27
28
33 public function __construct(int $id = 0, bool $a_call_by_reference = true)
34 {
35 $this->setType(self::TYPE);
36 parent::__construct($id, $a_call_by_reference);
37 }
38
39
40 public function read(): void
41 {
42 parent::read();
43 }
44
45
46 public function create(): int
47 {
48 $this->setOfflineStatus(true);
49 parent::create();
51 //$this->_writeContainerSetting($this->getId(), ilObjectServiceSettingsGUI::ORGU_POSITION_ACCESS, true);
52 return $this->getId();
53 }
54
55
56 public function update(): bool
57 {
58 return parent::update();
59 }
60
61
65 public static function getRootOrgRefId(): int
66 {
68
69 return self::$root_ref_id;
70 }
71
72
76 public static function getRootOrgId(): int
77 {
79
80 return self::$root_id;
81 }
82
83
84 private static function loadRootOrgRefIdAndId(): void
85 {
86 if (self::$root_ref_id === -1 || self::$root_id === -1) {
87 global $DIC;
88 $ilDB = $DIC['ilDB'];
89 $q = "SELECT o.obj_id, r.ref_id FROM object_data o
90 INNER JOIN object_reference r ON r.obj_id = o.obj_id
91 WHERE title = " . $ilDB->quote('__TalkTemplateAdministration', 'text') . "";
92 $set = $ilDB->query($q);
93 $res = $ilDB->fetchAssoc($set);
94 self::$root_id = (int) $res["obj_id"];
95 self::$root_ref_id = (int) $res["ref_id"];
96 }
97 }
98
105 public static function _exists(int $id, bool $reference = false, ?string $type = null): bool
106 {
107 return parent::_exists($id, $reference, self::TYPE);
108 }
109
116 public function delete(): bool
117 {
118 return parent::delete();
119 }
120}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create()
note: title, description and type should be set when this function is called
__construct(int $id=0, bool $a_call_by_reference=true)
static _exists(int $id, bool $reference=false, ?string $type=null)
setType(string $type)
setOfflineStatus(bool $status)
string $type
global $DIC
Definition: feed.php:28
$res
Definition: ltiservices.php:69
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc