ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilObjEmployeeTalkSeries.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
string $type
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
$container
Definition: wac.php:36
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setType(string $type)
$GLOBALS["DIC"]
Definition: wac.php:53
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:23
__construct(Container $dic, ilPlugin $plugin)
__construct(int $a_id=0, bool $a_call_by_reference=true)
static _exists(int $id, bool $reference=false, ?string $type=null)