ILIAS  release_8 Revision v8.24
class.ilObjEmployeeTalkSeries.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
23
25{
26 public const TYPE = 'tals';
27
29
33 private bool $locked_editing = false;
34
39 public function __construct(int $a_id = 0, bool $a_call_by_reference = true, bool $locked_editing = false)
40 {
41 $this->setType(self::TYPE);
42 $this->locked_editing = $locked_editing;
43
44 parent::__construct($a_id, $a_call_by_reference);
45
46 $this->repository = new IliasDBEmployeeTalkSeriesRepository($this->user, $this->db);
47 }
48
49 public function read(): void
50 {
51 parent::read();
52 }
53
54 public function create(): int
55 {
56 $this->setOfflineStatus(true);
57
58 parent::create();
59
61
62
66 $container = $GLOBALS['DIC'];
67
68 $container->event()->raise(
69 'Modules/EmployeeTalk',
70 'create',
71 ['object' => $this,
72 'obj_id' => $this->getId(),
73 'appointments' => []
74 ]
75 );
76
77 return $this->getId();
78 }
79
80
81
82 public function update(): bool
83 {
84 $ret = parent::update();
85
89 $container = $GLOBALS['DIC'];
90
91 $container->event()->raise(
92 'Modules/EmployeeTalk',
93 'update',
94 ['object' => $this,
95 'obj_id' => $this->getId(),
96 'appointments' => []
97 ]
98 );
99 return $ret;
100 }
101
108 public static function _exists(int $a_id, bool $a_reference = false, ?string $type = null): bool
109 {
110 return parent::_exists($a_id, $a_reference, self::TYPE);
111 }
112
118 public function delete(): bool
119 {
123 $container = $GLOBALS['DIC'];
124
125 $container->event()->raise(
126 'Modules/EmployeeTalk',
127 'delete',
128 [
129 'object' => $this,
130 'obj_id' => $this->getId(),
131 'appointments' => []
132 ]
133 );
134
135 $this->repository->deleteEmployeeTalkSerieSettings($this->getId());
136 $node_data = $this->tree->getNodeData($this->getRefId());
137 $result = parent::delete();
138 $this->tree->deleteNode($node_data['tree'], $this->getRefId());
139
140 return $result;
141 }
142
143 public function hasChildren(): bool
144 {
145 $children = $this->tree->getChildIds(intval($this->getRefId()));
146 return count($children) > 0;
147 }
148}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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)
create()
note: title, description and type should be set when this function is called
__construct(int $a_id=0, bool $a_call_by_reference=true, bool $locked_editing=false)
IliasDBEmployeeTalkSeriesRepository $repository
static _exists(int $a_id, bool $a_reference=false, ?string $type=null)
setType(string $type)
setOfflineStatus(bool $status)
string $type
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$container
@noRector
Definition: wac.php:14