18 declare(strict_types=1);
42 array $machines_string = []
45 $this->machines_string = array_merge($default_machines->get(),
$machines_string);
51 $definition_id = $definition->getFlavourMachineId();
53 $machine_string = $this->machines_string[$definition_id] ??
null;
54 if ($machine_string === null) {
55 return $null_machine->withReason(
'No machine found for definition ' . $definition->getId());
57 if (isset($this->machines_instances[$definition_id])) {
58 return $this->machines_instances[$definition_id];
61 $machine =
new $machine_string();
63 return $null_machine->withReason(
'Could not instantiate machine ' . $machine_string);
67 return $null_machine->withReason(
'Machine ' . $machine_string .
' does not implement FlavourMachine');
70 $engine = $this->engines->get($machine);
73 return $null_machine->withReason(
74 'Machine ' . $machine_string .
' depends on engine ' .
75 $machine->dependsOnEngine()
76 .
' which is not running or available.' 80 $machine = $machine->withEngine($engine);
82 return $this->machines_instances[$definition_id] = $machine;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
array $machines_instances
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private \ILIAS\ResourceStorage\Flavour\Engine\Factory $engines, array $machines_string=[])