ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\MetaData\Structure\LOMStructureInitiator Class Reference
+ Collaboration diagram for ILIAS\MetaData\Structure\LOMStructureInitiator:

Public Member Functions

 __construct (protected ReaderFactoryInterface $reader_factory, protected StructureFactory $structure_factory)
 
 set ()
 

Protected Member Functions

 getStructureRoot ()
 
 getSubElements (int $depth, ReaderInterface ... $readers)
 

Detailed Description

Definition at line 32 of file LOMStructureInitiator.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Structure\LOMStructureInitiator::__construct ( protected ReaderFactoryInterface  $reader_factory,
protected StructureFactory  $structure_factory 
)

Definition at line 34 of file LOMStructureInitiator.php.

37 {
38 }

Member Function Documentation

◆ getStructureRoot()

ILIAS\MetaData\Structure\LOMStructureInitiator::getStructureRoot ( )
protected

Definition at line 47 of file LOMStructureInitiator.php.

47 : StructureElementInterface
48 {
49 $reader = $this->reader_factory->reader();
50 return $this->structure_factory->root(
51 $reader->definition(),
52 ...$this->getSubElements(0, ...$reader->subDefinitions())
53 );
54 }

Referenced by ILIAS\MetaData\Structure\LOMStructureInitiator\set().

+ Here is the caller graph for this function:

◆ getSubElements()

ILIAS\MetaData\Structure\LOMStructureInitiator::getSubElements ( int  $depth,
ReaderInterface ...  $readers 
)
protected
Returns
Generator<StructureElement>
Exceptions
ilMDStructureException

Definition at line 60 of file LOMStructureInitiator.php.

63 : Generator {
64 if ($depth > 20) {
65 throw new ilMDStructureException('LOM Structure is nested to deep.');
66 }
67 foreach ($readers as $reader) {
68 yield $this->structure_factory->structure(
69 $reader->definition(),
70 ...$this->getSubElements($depth + 1, ...$reader->subDefinitions())
71 );
72 }
73 }

◆ set()

ILIAS\MetaData\Structure\LOMStructureInitiator::set ( )

Definition at line 40 of file LOMStructureInitiator.php.

40 : StructureSetInterface
41 {
42 return $this->structure_factory->set(
43 $this->getStructureRoot()
44 );
45 }

References ILIAS\MetaData\Structure\LOMStructureInitiator\getStructureRoot().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: