ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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...
 
 manipulate (int $obj_id, int $sub_id, string $type)
 Get a manipulator, which can manipulate the 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...
 

Protected Attributes

InternalServices $internal_services
 
PathsInterface $paths
 
DataHelperInterface $data_helper
 

Detailed Description

Definition at line 34 of file Services.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 41 of file Services.php.

42  {
43  $this->internal_services = new InternalServices($dic);
44  }
$dic
Definition: result.php:32

Member Function Documentation

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

References ILIAS\MetaData\Services\Services\$data_helper.

88  : DataHelperInterface
89  {
90  if (isset($this->data_helper)) {
91  return $this->data_helper;
92  }
93  return new DataHelper(
94  $this->internal_services->dataHelper()->dataHelper(),
95  $this->internal_services->presentation()->data()
96  );
97  }
DataHelperInterface $data_helper
Definition: Services.php:39

◆ 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.

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'.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 68 of file Services.php.

68  : ManipulatorInterface
69  {
70  $repo = $this->internal_services->repository()->repository();
71  $set = $repo->getMD($obj_id, $sub_id, $type);
72  return new Manipulator(
73  $this->internal_services->manipulator()->manipulator(),
74  $set
75  );
76  }

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

References ILIAS\MetaData\Services\Services\$paths.

78  : PathsInterface
79  {
80  if (isset($this->paths)) {
81  return $this->paths;
82  }
83  return new Paths(
84  $this->internal_services->paths()->pathFactory()
85  );
86  }
paths()
Elements in LOM are identified by paths to them from the root.
Definition: Services.php:78

◆ 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 all sub-elements of the last element of the path.

Implements ILIAS\MetaData\Services\ServicesInterface.

Definition at line 46 of file Services.php.

51  : ReaderInterface {
52  if ($sub_id === 0) {
53  $sub_id = $obj_id;
54  }
55 
56  $repo = $this->internal_services->repository()->repository();
57  if (isset($limited_to)) {
58  $set = $repo->getMDOnPath($limited_to, $obj_id, $sub_id, $type);
59  } else {
60  $set = $repo->getMD($obj_id, $sub_id, $type);
61  }
62  return new Reader(
63  $this->internal_services->paths()->navigatorFactory(),
64  $set
65  );
66  }

Field Documentation

◆ $data_helper

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

Definition at line 39 of file Services.php.

Referenced by ILIAS\MetaData\Services\Services\dataHelper().

◆ $internal_services

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

Definition at line 36 of file Services.php.

◆ $paths

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

Definition at line 38 of file Services.php.

Referenced by ILIAS\MetaData\Services\Services\paths().


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