ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
StructureFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
26 {
27  public function structure(
28  DefinitionInterface $definition,
29  StructureElement ...$sub_elements
30  ): StructureElement {
31  return $this->element(false, $definition, ...$sub_elements);
32  }
33 
34  public function root(
35  DefinitionInterface $definition,
36  StructureElement ...$sub_elements
38  return $this->element(true, $definition, ...$sub_elements);
39  }
40 
41  protected function element(
42  bool $is_root,
43  DefinitionInterface $definition,
44  StructureElement ...$sub_elements
45  ): StructureElement {
46  return new StructureElement(
47  $is_root,
48  $definition,
49  ...$sub_elements
50  );
51  }
52 
53  public function set(
56  return new StructureSet($root);
57  }
58 }
root(DefinitionInterface $definition, StructureElement ... $sub_elements)
structure(DefinitionInterface $definition, StructureElement ... $sub_elements)
element(bool $is_root, DefinitionInterface $definition, StructureElement ... $sub_elements)