ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilObjEmployeeTalkSeries.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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  parent::create();
57 
59 
60 
64  $container = $GLOBALS['DIC'];
65 
66  $container->event()->raise(
67  'components/ILIAS/EmployeeTalk',
68  'create',
69  ['object' => $this,
70  'obj_id' => $this->getId(),
71  'appointments' => []
72  ]
73  );
74 
75  return $this->getId();
76  }
77 
78 
79 
80  public function update(): bool
81  {
82  $ret = parent::update();
83 
87  $container = $GLOBALS['DIC'];
88 
89  $container->event()->raise(
90  'components/ILIAS/EmployeeTalk',
91  'update',
92  ['object' => $this,
93  'obj_id' => $this->getId(),
94  'appointments' => []
95  ]
96  );
97  return $ret;
98  }
99 
106  public static function _exists(int $a_id, bool $a_reference = false, ?string $type = null): bool
107  {
108  return parent::_exists($a_id, $a_reference, self::TYPE);
109  }
110 
116  public function delete(): bool
117  {
121  $container = $GLOBALS['DIC'];
122 
123  $container->event()->raise(
124  'components/ILIAS/EmployeeTalk',
125  'delete',
126  [
127  'object' => $this,
128  'obj_id' => $this->getId(),
129  'appointments' => []
130  ]
131  );
132 
133  $this->repository->deleteEmployeeTalkSerieSettings($this->getId());
134  $node_data = $this->tree->getNodeData($this->getRefId());
135  $result = parent::delete();
136  $this->tree->deleteNode($node_data['tree'], $this->getRefId());
137 
138  return $result;
139  }
140 
141  public function hasChildren(): bool
142  {
143  $children = $this->tree->getChildIds($this->getRefId());
144  return count($children) > 0;
145  }
146 
150  public function getChildTalks(): array
151  {
152  $child_ids = $this->tree->getChildIds($this->getRefId());
153  $child_talks = [];
154  foreach ($child_ids as $id) {
155  $child_talks[] = new ilObjEmployeeTalk($id, true);
156  }
157  return $child_talks;
158  }
159 }
string $type
repository()
description: > Example for rendering a repository card
Definition: repository.php:17
__construct(int $a_id=0, bool $a_call_by_reference=true, bool $locked_editing=false)
static _exists(int $a_id, bool $a_reference=false, ?string $type=null)
$container
Definition: wac.php:13
setType(string $type)
$GLOBALS["DIC"]
Definition: wac.php:30
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)
IliasDBEmployeeTalkSeriesRepository $repository
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...