ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjEmployeeTalkSeries.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
25{
26 public const string TYPE = 'tals';
27
29
30 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
31 {
32 $this->setType(self::TYPE);
33
34 parent::__construct($a_id, $a_call_by_reference);
35
36 $this->repository = new IliasDBEmployeeTalkSeriesRepository($this->user, $this->db);
37 }
38
39 public function create(): int
40 {
41 parent::create();
42
44
45
49 $container = $GLOBALS['DIC'];
50
51 $container->event()->raise(
52 'components/ILIAS/EmployeeTalk',
53 'create',
54 ['object' => $this,
55 'obj_id' => $this->getId(),
56 'appointments' => []
57 ]
58 );
59
60 return $this->getId();
61 }
62
63
64
65 public function update(): bool
66 {
67 $ret = parent::update();
68
72 $container = $GLOBALS['DIC'];
73
74 $container->event()->raise(
75 'components/ILIAS/EmployeeTalk',
76 'update',
77 ['object' => $this,
78 'obj_id' => $this->getId(),
79 'appointments' => []
80 ]
81 );
82 return $ret;
83 }
84
85 public static function _exists(int $id, bool $reference = false, ?string $type = null): bool
86 {
87 return parent::_exists($id, $reference, self::TYPE);
88 }
89
95 public function delete(): bool
96 {
100 $container = $GLOBALS['DIC'];
101
102 $container->event()->raise(
103 'components/ILIAS/EmployeeTalk',
104 'delete',
105 [
106 'object' => $this,
107 'obj_id' => $this->getId(),
108 'appointments' => []
109 ]
110 );
111
112 $this->repository->deleteEmployeeTalkSerieSettings($this->getId());
113 $node_data = $this->tree->getNodeData($this->getRefId());
114 $result = parent::delete();
115 $this->tree->deleteNode($node_data['tree'], $this->getRefId());
116
117 return $result;
118 }
119
120 public function hasChildren(): bool
121 {
122 $children = $this->tree->getChildIds($this->getRefId());
123 return count($children) > 0;
124 }
125
129 public function getChildTalks(): array
130 {
131 $child_ids = $this->tree->getChildIds($this->getRefId());
132 $child_talks = [];
133 foreach ($child_ids as $id) {
134 $child_talks[] = new ilObjEmployeeTalk($id, true);
135 }
136 return $child_talks;
137 }
138}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Class ilContainer.
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
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
__construct(int $a_id=0, bool $a_call_by_reference=true)
IliasDBEmployeeTalkSeriesRepository $repository
setType(string $type)
string $type
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$container
@noRector
Definition: wac.php:37
$GLOBALS["DIC"]
Definition: wac.php:54