ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
AbstractMachine.php
Go to the documentation of this file.
1 <?php
18 declare(strict_types=1);
19 
21 
24 
29 abstract class AbstractMachine implements FlavourMachine
30 {
31  protected ?Engine $engine = null;
32 
33  public function __construct()
34  {
35  }
36 
37  public function withEngine(Engine $engine): FlavourMachine
38  {
39  $clone = clone $this;
40  $clone->engine = $engine;
41  return $clone;
42  }
43 
44  public function getEngine(): Engine
45  {
46  if ($this->engine === null) {
47  throw new \OutOfBoundsException("Engine not available");
48  }
49  return $this->engine;
50  }
51 }
withEngine(Engine $engine)
The demanded Engine will be passed here.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
FlavourMachines must be able to be created without further dependencies.