ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\Survey\Metadata\MetadataManager Class Reference
+ Collaboration diagram for ILIAS\Survey\Metadata\MetadataManager:

Public Member Functions

 __construct (LOMServices $lom_services)
 
 getAuthorsFromLOM (int $obj_id, int $sub_id, string $type)
 
 saveAuthorsInLOMIfNoLifecycleSet (int $obj_id, int $sub_id, string $type, string $author)
 

Protected Attributes

LOMServices $lom_services
 

Detailed Description

Definition at line 25 of file class.MetadataManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Metadata\MetadataManager::__construct ( LOMServices  $lom_services)

Definition at line 29 of file class.MetadataManager.php.

References ILIAS\Survey\Metadata\MetadataManager\$lom_services.

30  {
31  $this->lom_services = $lom_services;
32  }

Member Function Documentation

◆ getAuthorsFromLOM()

ILIAS\Survey\Metadata\MetadataManager::getAuthorsFromLOM ( int  $obj_id,
int  $sub_id,
string  $type 
)

Definition at line 34 of file class.MetadataManager.php.

38  : string {
39  $path_to_authors = $this->lom_services->paths()->authors();
40  $author_data = $this->lom_services->read($obj_id, $sub_id, $type, $path_to_authors)
41  ->allData($path_to_authors);
42 
43  return $this->lom_services->dataHelper()->makePresentableAsList(',', ...$author_data);
44  }

◆ saveAuthorsInLOMIfNoLifecycleSet()

ILIAS\Survey\Metadata\MetadataManager::saveAuthorsInLOMIfNoLifecycleSet ( int  $obj_id,
int  $sub_id,
string  $type,
string  $author 
)

Definition at line 46 of file class.MetadataManager.php.

51  : void {
52  $path_to_lifecycle = $this->lom_services->paths()->custom()->withNextStep('lifeCycle')->get();
53  $path_to_authors = $this->lom_services->paths()->authors();
54 
55  $reader = $this->lom_services->read($obj_id, $sub_id, $type, $path_to_lifecycle);
56  if (!is_null($reader->allData($path_to_lifecycle)->current())) {
57  return;
58  }
59 
60  $this->lom_services->manipulate($obj_id, $sub_id, $type)
61  ->prepareCreateOrUpdate($path_to_authors, $author)
62  ->execute();
63  }

Field Documentation

◆ $lom_services

LOMServices ILIAS\Survey\Metadata\MetadataManager::$lom_services
protected

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