ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\MetaData\Structure\LOMStructureInitiator Class Reference
+ Collaboration diagram for ILIAS\MetaData\Structure\LOMStructureInitiator:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

ReaderFactoryInterface $reader_factory
 
StructureFactory $structure_factory
 

Detailed Description

Definition at line 34 of file LOMStructureInitiator.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ getStructureRoot()

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

Definition at line 54 of file LOMStructureInitiator.php.

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

54  : StructureElementInterface
55  {
56  $reader = $this->reader_factory->reader();
57  return $this->structure_factory->root(
58  $reader->definition(),
59  ...$this->getSubElements(0, ...$reader->subDefinitions())
60  );
61  }
+ Here is the caller graph for this function:

◆ getSubElements()

ILIAS\MetaData\Structure\LOMStructureInitiator::getSubElements ( int  $depth,
ReaderInterface ...  $readers 
)
protected
Returns
StructureElement[]

Definition at line 66 of file LOMStructureInitiator.php.

69  : \Generator {
70  if ($depth > 20) {
71  throw new \ilMDStructureException('LOM Structure is nested to deep.');
72  }
73  foreach ($readers as $reader) {
74  yield $this->structure_factory->structure(
75  $reader->definition(),
76  ...$this->getSubElements($depth + 1, ...$reader->subDefinitions())
77  );
78  }
79  }

◆ set()

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

Definition at line 47 of file LOMStructureInitiator.php.

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

47  : StructureSetInterface
48  {
49  return $this->structure_factory->set(
50  $this->getStructureRoot()
51  );
52  }
+ Here is the call graph for this function:

Field Documentation

◆ $reader_factory

ReaderFactoryInterface ILIAS\MetaData\Structure\LOMStructureInitiator::$reader_factory
protected

◆ $structure_factory

StructureFactory ILIAS\MetaData\Structure\LOMStructureInitiator::$structure_factory
protected

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