ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\ILIASObject\Properties\Aggregator Class Reference

Description of class. More...

+ Collaboration diagram for ILIAS\ILIASObject\Properties\Aggregator:

Public Member Functions

 __construct (private readonly CorePropertiesRepository $core_properties_repository, private readonly AdditionalPropertiesRepository $additional_properties_repository, private readonly TranslationsRepository $translations_repository, private readonly ObjectTypeSpecificPropertiesFactory $object_type_specific_properties_factory, private readonly LOMServices $lom_services)
 
 getFor (int $object_id, ?string $type=null)
 
 preload (array $object_ids)
 

Detailed Description

Description of class.

Author
Stephan Kergomard

Definition at line 34 of file Aggregator.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ILIASObject\Properties\Aggregator::__construct ( private readonly CorePropertiesRepository  $core_properties_repository,
private readonly AdditionalPropertiesRepository  $additional_properties_repository,
private readonly TranslationsRepository  $translations_repository,
private readonly ObjectTypeSpecificPropertiesFactory  $object_type_specific_properties_factory,
private readonly LOMServices  $lom_services 
)

Definition at line 36 of file Aggregator.php.

42  {
43  }

Member Function Documentation

◆ getFor()

ILIAS\ILIASObject\Properties\Aggregator::getFor ( int  $object_id,
?string  $type = null 
)

Definition at line 45 of file Aggregator.php.

45  : Properties
46  {
47  $core_properties = $this->core_properties_repository->getFor($object_id, $type);
48 
49  return new Properties(
50  $core_properties,
51  $this->core_properties_repository,
52  $this->additional_properties_repository->getFor($object_id),
53  $this->additional_properties_repository,
54  $this->translations_repository->getFor($object_id),
55  $this->translations_repository,
56  $this->lom_services
57  );
58  }

◆ preload()

ILIAS\ILIASObject\Properties\Aggregator::preload ( array  $object_ids)

Definition at line 60 of file Aggregator.php.

References ilObject\_lookupType().

60  : void
61  {
62  $this->core_properties_repository->preload($object_ids);
63  $objects_by_type = [];
64  foreach ($object_ids as $obj_id) {
65  $type = \ilObject::_lookupType($obj_id);
66 
67  if (!array_key_exists($type, $objects_by_type)) {
68  $objects_by_type[$type] = [];
69  }
70  $objects_by_type[$type][] = $obj_id;
71  }
72 
73  foreach ($objects_by_type as $type => $obj_ids) {
74  $this->object_type_specific_properties_factory->getForObjectTypeString($type)?->preload($obj_ids);
75  }
76  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

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