ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
CreationCallbackTrait.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Object;
22 
24 {
25  public function callCreationCallback(
26  \ilObject $obj,
27  \ilObjectDefinition $obj_definition,
28  int $requested_crtcb
29  ): void {
30  if ($requested_crtcb === 0) {
31  return;
32  }
33 
34  $callback_type = \ilObject::_lookupType((int) $requested_crtcb, true);
35  $class_name = 'ilObj' . $obj_definition->getClassName($callback_type) . 'GUI';
36 
37  if (strtolower($class_name) === 'ilobjitemgroupgui') {
38  $callback_obj = new $class_name((int) $requested_crtcb);
39  } else {
40  $callback_obj = new $class_name(null, $requested_crtcb, true, false);
41  }
42  $callback_obj->afterSaveCallback($obj);
43  }
44 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getClassName(string $obj_name)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: ilObjectDIC.php:21