ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ScaffoldFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
32 
34 {
37 
38  public function __construct(
39  DataFactoryInterface $data_factory,
40  RessourceIDFactoryInterface $ressource_id_factory
41  ) {
42  $this->data_factory = $data_factory;
43  $this->ressource_id_factory = $ressource_id_factory;
44  }
45 
46  public function scaffold(DefinitionInterface $definition): ElementInterface
47  {
48  return new Element(
49  NoID::SCAFFOLD,
50  $definition,
51  $this->data_factory->null()
52  );
53  }
54 
55  public function set(DefinitionInterface $root_definition): SetInterface
56  {
57  return new Set(
58  $this->ressource_id_factory->null(),
59  new Element(
60  NoID::ROOT,
61  $root_definition,
62  $this->data_factory->null()
63  )
64  );
65  }
66 }
__construct(DataFactoryInterface $data_factory, RessourceIDFactoryInterface $ressource_id_factory)