ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MetaData\Services\Reader\Reader Class Reference
+ Inheritance diagram for ILIAS\MetaData\Services\Reader\Reader:
+ Collaboration diagram for ILIAS\MetaData\Services\Reader\Reader:

Public Member Functions

 __construct (NavigatorFactoryInterface $navigator_factory, SetInterface $set)
 
 allData (PathInterface $path)
 
 firstData (PathInterface $path)
 Get the data of the first of the elements specified by the path. More...
 
 allData (PathInterface $path)
 Get the data of all elements specified by the path. More...
 
 firstData (PathInterface $path)
 Get the data of the first of the elements specified by the path. More...
 

Protected Attributes

NavigatorFactoryInterface $navigator_factory
 
SetInterface $set
 

Detailed Description

Definition at line 29 of file Reader.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Services\Reader\Reader::__construct ( NavigatorFactoryInterface  $navigator_factory,
SetInterface  $set 
)

Definition at line 34 of file Reader.php.

37 {
38 $this->navigator_factory = $navigator_factory;
39 $this->set = $set;
40 }
NavigatorFactoryInterface $navigator_factory
Definition: Reader.php:31

References ILIAS\MetaData\Services\Reader\Reader\$navigator_factory, and ILIAS\MetaData\Services\Reader\Reader\$set.

Referenced by ILIAS\MetaData\Services\Reader\ReaderTest\getPath(), and ILIAS\MetaData\Services\Reader\ReaderTest\getReader().

+ Here is the caller graph for this function:

Member Function Documentation

◆ allData()

ILIAS\MetaData\Services\Reader\Reader::allData ( PathInterface  $path)
Returns
DataInterface[]

Implements ILIAS\MetaData\Services\Reader\ReaderInterface.

Definition at line 45 of file Reader.php.

45 : \Generator
46 {
47 $navigator = $this->navigator_factory->navigator($path, $this->set->getRoot());
48 foreach ($navigator->elementsAtFinalStep() as $element) {
49 yield $element->getData();
50 }
51 }
$path
Definition: ltiservices.php:30

References $path.

◆ firstData()

ILIAS\MetaData\Services\Reader\Reader::firstData ( PathInterface  $path)

Get the data of the first of the elements specified by the path.

Implements ILIAS\MetaData\Services\Reader\ReaderInterface.

Definition at line 53 of file Reader.php.

53 : DataInterface
54 {
55 $navigator = $this->navigator_factory->navigator($path, $this->set->getRoot());
56 if ($first = $navigator->elementsAtFinalStep()->current()) {
57 return $first->getData();
58 }
59 return new NullData();
60 }

References $path.

Field Documentation

◆ $navigator_factory

NavigatorFactoryInterface ILIAS\MetaData\Services\Reader\Reader::$navigator_factory
protected

Definition at line 31 of file Reader.php.

Referenced by ILIAS\MetaData\Services\Reader\Reader\__construct().

◆ $set

SetInterface ILIAS\MetaData\Services\Reader\Reader::$set
protected

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