ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 49 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 61 of file Services.php.

62 {
63 $this->internal_services = new InternalServices($dic);
64 }
$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 154 of file Services.php.

154 : CopyrightHelperInterface
155 {
156 if (isset($this->copyright_helper)) {
158 }
159 return $this->copyright_helper = new CopyrightHelper(
161 $this->internal_services->paths()->pathFactory(),
162 $this->internal_services->copyright()->repository(),
163 $this->internal_services->copyright()->identifiersHandler(),
164 $this->internal_services->copyright()->renderer(),
165 $this->internal_services->search()->searchClauseFactory()
166 );
167 }
CopyrightHelperInterface $copyright_helper
Definition: Services.php:59

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 143 of file Services.php.

143 : DataHelperInterface
144 {
145 if (isset($this->data_helper)) {
146 return $this->data_helper;
147 }
148 return $this->data_helper = new DataHelper(
149 $this->internal_services->dataHelper()->dataHelper(),
150 $this->internal_services->presentation()->data()
151 );
152 }
DataHelperInterface $data_helper
Definition: Services.php:56

◆ 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 123 of file Services.php.

123 : void
124 {
125 if ($sub_id === 0) {
126 $sub_id = $obj_id;
127 }
128
129 $repo = $this->repository();
130 $repo->deleteAllMD($obj_id, $sub_id, $type);
131 }

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 108 of file Services.php.

108 : SourceSelectorInterface
109 {
110 if (isset($this->derivation_source_selector)) {
112 }
113 return $this->derivation_source_selector = new SourceSelector(
114 $this->internal_services->repository()->repository(),
115 new Creator(
116 $this->internal_services->manipulator()->manipulator(),
117 $this->internal_services->paths()->pathFactory(),
118 $this->internal_services->manipulator()->scaffoldProvider()
119 )
120 );
121 }
SourceSelectorInterface $derivation_source_selector
Definition: Services.php:57

◆ 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 97 of file Services.php.

97 : ManipulatorInterface
98 {
99 if ($sub_id === 0) {
100 $sub_id = $obj_id;
101 }
102
103 $repo = $this->repository();
104 $set = $repo->getMD($obj_id, $sub_id, $type);
105 return $this->manipulatorFactory()->get($set);
106 }

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

+ Here is the call graph for this function:

◆ manipulatorFactory()

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

Definition at line 179 of file Services.php.

179 : ManipulatorFactoryInterface
180 {
181 if (isset($this->manipulator_factory)) {
183 }
184 return $this->manipulator_factory = new ManipulatorFactory(
185 $this->internal_services->manipulator()->manipulator(),
186 $this->internal_services->repository()->repository()
187 );
188 }
ManipulatorFactoryInterface $manipulator_factory
Definition: Services.php:54

◆ 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 133 of file Services.php.

133 : PathsInterface
134 {
135 if (isset($this->paths)) {
136 return $this->paths;
137 }
138 return $this->paths = new Paths(
139 $this->internal_services->paths()->pathFactory()
140 );
141 }
paths()
Elements in LOM are identified by paths to them from the root.
Definition: Services.php:133

◆ 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 66 of file Services.php.

71 : ReaderInterface {
72 if ($sub_id === 0) {
73 $sub_id = $obj_id;
74 }
75
76 $repo = $this->repository();
77 if (isset($limited_to)) {
78 $set = $repo->getMDOnPath($limited_to, $obj_id, $sub_id, $type);
79 } else {
80 $set = $repo->getMD($obj_id, $sub_id, $type);
81 }
82 return $this->readerFactory()->get($set);
83 }

◆ readerFactory()

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

Definition at line 169 of file Services.php.

169 : ReaderFactoryInterface
170 {
171 if (isset($this->reader_factory)) {
173 }
174 return $this->reader_factory = new ReaderFactory(
175 $this->internal_services->paths()->navigatorFactory()
176 );
177 }
ReaderFactoryInterface $reader_factory
Definition: Services.php:53

◆ repository()

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

Definition at line 190 of file Services.php.

190 : RepositoryInterface
191 {
192 return $this->internal_services->repository()->repository();
193 }

◆ 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 85 of file Services.php.

85 : SearcherInterface
86 {
87 if (isset($this->searcher)) {
88 return $this->searcher;
89 }
90 return $this->searcher = new Searcher(
91 $this->internal_services->search()->searchClauseFactory(),
92 $this->internal_services->search()->searchFilterFactory(),
93 $this->internal_services->repository()->repository()
94 );
95 }
SearcherInterface $searcher
Definition: Services.php:58

Field Documentation

◆ $copyright_helper

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

Definition at line 59 of file Services.php.

◆ $data_helper

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

Definition at line 56 of file Services.php.

◆ $derivation_source_selector

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

Definition at line 57 of file Services.php.

◆ $internal_services

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

Definition at line 51 of file Services.php.

◆ $manipulator_factory

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

Definition at line 54 of file Services.php.

◆ $paths

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

Definition at line 55 of file Services.php.

◆ $reader_factory

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

Definition at line 53 of file Services.php.

◆ $searcher

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

Definition at line 58 of file Services.php.


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