ILIAS  release_7 Revision v7.30-3-g800a261c036
CreationCallbackTrait.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Object;
22
23trait CreationCallbackTrait
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}
An exception for terminatinating execution or to throw for unit testing.
parses the objects.xml it handles the xml-description of all ilias objects
Class ilObject Basic functions for all objects.
static _lookupType($a_id, $a_reference=false)
lookup object type
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...