ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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...
 

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.

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().

37  {
38  $this->navigator_factory = $navigator_factory;
39  $this->set = $set;
40  }
NavigatorFactoryInterface $navigator_factory
Definition: Reader.php:31
+ 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:29

◆ 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  }
$path
Definition: ltiservices.php:29

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: