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

Public Member Functions

 __construct (GlobalContainer $dic)
 
 read (int $obj_id, int $sub_id, string $type, ?PathInterface $limited_to=null)
 Get a reader, which can read out LOM of an ILIAS object. More...
 
 search ()
 Get a searcher, in which you can assemble a search clause and filters, and use these to find objects whose LOM matches the search. More...
 
 manipulate (int $obj_id, int $sub_id, string $type)
 Get a manipulator, which can manipulate the LOM of an ILIAS object. More...
 
 derive ()
 Derives LOM from a target, for a source. More...
 
 deleteAll (int $obj_id, int $sub_id, string $type)
 Delete all LOM of an ILIAS object. More...
 
 paths ()
 Elements in LOM are identified by paths to them from the root. More...
 
 dataHelper ()
 The data carried by many LOM elements is in LOM-specific formats. More...
 
 copyrightHelper ()
 The LOM of an object also contains its copyright information, which might consist of a reference to a preset copyright. More...
 
 read (int $obj_id, int $sub_id, string $type, ?PathInterface $limited_to=null)
 Get a reader, which can read out LOM of an ILIAS object. More...
 
 search ()
 Get a searcher, in which you can assemble a search clause and filters, and use these to find objects whose LOM matches the search. More...
 
 manipulate (int $obj_id, int $sub_id, string $type)
 Get a manipulator, which can manipulate the LOM of an ILIAS object. More...
 
 derive ()
 Derives LOM from a target, for a source. More...
 
 deleteAll (int $obj_id, int $sub_id, string $type)
 Delete all LOM of an ILIAS object. More...
 
 paths ()
 Elements in LOM are identified by paths to them from the root. More...
 
 dataHelper ()
 The data carried by many LOM elements is in LOM-specific formats. More...
 
 copyrightHelper ()
 The LOM of an object also contains its copyright information, which might consist of a reference to a preset copyright. More...
 

Protected Member Functions

 readerFactory ()
 
 manipulatorFactory ()
 
 repository ()
 

Protected Attributes

InternalServices $internal_services
 
ReaderFactoryInterface $reader_factory
 
ManipulatorFactoryInterface $manipulator_factory
 
PathsInterface $paths
 
DataHelperInterface $data_helper
 
SourceSelectorInterface $derivation_source_selector
 
SearcherInterface $searcher
 
CopyrightHelperInterface $copyright_helper
 

Detailed Description

Definition at line 44 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Services\Services::__construct ( GlobalContainer  $dic)

Definition at line 56 of file Services.php.

57 {
58 $this->internal_services = new InternalServices($dic);
59 }
$dic
Definition: ltiresult.php:33

References $dic.

Member Function Documentation

◆ copyrightHelper()

ILIAS\MetaData\Services\Services::copyrightHelper ( )

The LOM of an object also contains its copyright information, which might consist of a reference to a preset copyright.

This helper offers some infrastructure to parse and manipulate copyright information of objects, to access the copyright presets, and to search and filter objects by copyright.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 149 of file Services.php.

149 : CopyrightHelperInterface
150 {
151 if (isset($this->copyright_helper)) {
153 }
154 return $this->copyright_helper = new CopyrightHelper(
156 $this->internal_services->paths()->pathFactory(),
157 $this->internal_services->copyright()->repository(),
158 $this->internal_services->copyright()->identifiersHandler(),
159 $this->internal_services->copyright()->renderer(),
160 $this->internal_services->search()->searchClauseFactory()
161 );
162 }
CopyrightHelperInterface $copyright_helper
Definition: Services.php:54

References ilMDSettings\_getInstance().

+ Here is the call graph for this function:

◆ dataHelper()

ILIAS\MetaData\Services\Services::dataHelper ( )

The data carried by many LOM elements is in LOM-specific formats.

Get a collection of helpful translations from or to these formats.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 138 of file Services.php.

138 : DataHelperInterface
139 {
140 if (isset($this->data_helper)) {
141 return $this->data_helper;
142 }
143 return $this->data_helper = new DataHelper(
144 $this->internal_services->dataHelper()->dataHelper(),
145 $this->internal_services->presentation()->data()
146 );
147 }
DataHelperInterface $data_helper
Definition: Services.php:51

◆ deleteAll()

ILIAS\MetaData\Services\Services::deleteAll ( int  $obj_id,
int  $sub_id,
string  $type 
)

Delete all LOM of an ILIAS object.

See {

See also
\ILIAS\MetaData\Services\ServicesInterface::read()} for a description of the parameters.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 118 of file Services.php.

118 : void
119 {
120 if ($sub_id === 0) {
121 $sub_id = $obj_id;
122 }
123
124 $repo = $this->repository();
125 $repo->deleteAllMD($obj_id, $sub_id, $type);
126 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ derive()

ILIAS\MetaData\Services\Services::derive ( )

Derives LOM from a target, for a source.

Encompasses both copying LOM between ILIAS objects and creating LOM for an object from some basic properties.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 103 of file Services.php.

103 : SourceSelectorInterface
104 {
105 if (isset($this->derivation_source_selector)) {
107 }
108 return $this->derivation_source_selector = new SourceSelector(
109 $this->internal_services->repository()->repository(),
110 new Creator(
111 $this->internal_services->manipulator()->manipulator(),
112 $this->internal_services->paths()->pathFactory(),
113 $this->internal_services->manipulator()->scaffoldProvider()
114 )
115 );
116 }
SourceSelectorInterface $derivation_source_selector
Definition: Services.php:52

◆ manipulate()

ILIAS\MetaData\Services\Services::manipulate ( int  $obj_id,
int  $sub_id,
string  $type 
)

Get a manipulator, which can manipulate the LOM of an ILIAS object.

See {

See also
\ILIAS\MetaData\Services\ServicesInterface::read()} for a description of the parameters.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 92 of file Services.php.

92 : ManipulatorInterface
93 {
94 if ($sub_id === 0) {
95 $sub_id = $obj_id;
96 }
97
98 $repo = $this->repository();
99 $set = $repo->getMD($obj_id, $sub_id, $type);
100 return $this->manipulatorFactory()->get($set);
101 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ manipulatorFactory()

ILIAS\MetaData\Services\Services::manipulatorFactory ( )
protected

Definition at line 174 of file Services.php.

174 : ManipulatorFactoryInterface
175 {
176 if (isset($this->manipulator_factory)) {
178 }
179 return $this->manipulator_factory = new ManipulatorFactory(
180 $this->internal_services->manipulator()->manipulator(),
181 $this->internal_services->repository()->repository()
182 );
183 }
ManipulatorFactoryInterface $manipulator_factory
Definition: Services.php:49

◆ paths()

ILIAS\MetaData\Services\Services::paths ( )

Elements in LOM are identified by paths to them from the root.

Get a collection of frequently used paths, as well as a builder to construct custom ones.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 128 of file Services.php.

128 : PathsInterface
129 {
130 if (isset($this->paths)) {
131 return $this->paths;
132 }
133 return $this->paths = new Paths(
134 $this->internal_services->paths()->pathFactory()
135 );
136 }
paths()
Elements in LOM are identified by paths to them from the root.
Definition: Services.php:128

◆ read()

ILIAS\MetaData\Services\Services::read ( int  $obj_id,
int  $sub_id,
string  $type,
?PathInterface  $limited_to = null 
)

Get a reader, which can read out LOM of an ILIAS object.

The object is specified with three parameters:

  1. obj_id: The obj_id of the object if it is a repository object, else the obj_id of its parent repository object. If the object does not have a fixed parent (e.g. MediaObject), then this parameter is 0.
  2. sub_id: The obj_id of the object. If the object is a repository object by itself and not a sub-object, then you can set this parameter to 0, but we recommend passing the obj_id again.
  3. type: The type of the object (and not its parent's), e.g. ‘'crs’or'lm'`.

Optionally, a path can be specified to which the reading is restricted: the reader will then only have access to elements on the path, along with recursively all sub-elements of the last element of the path. Note that path filters are ignored, and if the path contains steps to super elements, it is only followed down to the first element that the path returns to.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 61 of file Services.php.

66 : ReaderInterface {
67 if ($sub_id === 0) {
68 $sub_id = $obj_id;
69 }
70
71 $repo = $this->repository();
72 if (isset($limited_to)) {
73 $set = $repo->getMDOnPath($limited_to, $obj_id, $sub_id, $type);
74 } else {
75 $set = $repo->getMD($obj_id, $sub_id, $type);
76 }
77 return $this->readerFactory()->get($set);
78 }

◆ readerFactory()

ILIAS\MetaData\Services\Services::readerFactory ( )
protected

Definition at line 164 of file Services.php.

164 : ReaderFactoryInterface
165 {
166 if (isset($this->reader_factory)) {
168 }
169 return $this->reader_factory = new ReaderFactory(
170 $this->internal_services->paths()->navigatorFactory()
171 );
172 }
ReaderFactoryInterface $reader_factory
Definition: Services.php:48

◆ repository()

ILIAS\MetaData\Services\Services::repository ( )
protected

Definition at line 185 of file Services.php.

185 : RepositoryInterface
186 {
187 return $this->internal_services->repository()->repository();
188 }

◆ search()

ILIAS\MetaData\Services\Services::search ( )

Get a searcher, in which you can assemble a search clause and filters, and use these to find objects whose LOM matches the search.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 80 of file Services.php.

80 : SearcherInterface
81 {
82 if (isset($this->searcher)) {
83 return $this->searcher;
84 }
85 return $this->searcher = new Searcher(
86 $this->internal_services->search()->searchClauseFactory(),
87 $this->internal_services->search()->searchFilterFactory(),
88 $this->internal_services->repository()->repository()
89 );
90 }
SearcherInterface $searcher
Definition: Services.php:53

Field Documentation

◆ $copyright_helper

CopyrightHelperInterface ILIAS\MetaData\Services\Services::$copyright_helper
protected

Definition at line 54 of file Services.php.

◆ $data_helper

DataHelperInterface ILIAS\MetaData\Services\Services::$data_helper
protected

Definition at line 51 of file Services.php.

◆ $derivation_source_selector

SourceSelectorInterface ILIAS\MetaData\Services\Services::$derivation_source_selector
protected

Definition at line 52 of file Services.php.

◆ $internal_services

InternalServices ILIAS\MetaData\Services\Services::$internal_services
protected

Definition at line 46 of file Services.php.

◆ $manipulator_factory

ManipulatorFactoryInterface ILIAS\MetaData\Services\Services::$manipulator_factory
protected

Definition at line 49 of file Services.php.

◆ $paths

PathsInterface ILIAS\MetaData\Services\Services::$paths
protected

Definition at line 50 of file Services.php.

◆ $reader_factory

ReaderFactoryInterface ILIAS\MetaData\Services\Services::$reader_factory
protected

Definition at line 48 of file Services.php.

◆ $searcher

SearcherInterface ILIAS\MetaData\Services\Services::$searcher
protected

Definition at line 53 of file Services.php.


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