ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectPropertiesAgregator Class Reference

Description of class. More...

+ Collaboration diagram for ilObjectPropertiesAgregator:

Public Member Functions

 __construct (private ilObjectCorePropertiesRepository $core_properties_repository, private ilObjectAdditionalPropertiesRepository $additional_properties_repository, private ObjectTypeSpecificPropertiesFactory $object_type_specific_properties_factory, private 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 29 of file class.ilObjectPropertiesAgregator.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectPropertiesAgregator::__construct ( private ilObjectCorePropertiesRepository  $core_properties_repository,
private ilObjectAdditionalPropertiesRepository  $additional_properties_repository,
private ObjectTypeSpecificPropertiesFactory  $object_type_specific_properties_factory,
private LOMServices  $lom_services 
)

Definition at line 31 of file class.ilObjectPropertiesAgregator.php.

36  {
37  }

Member Function Documentation

◆ getFor()

ilObjectPropertiesAgregator::getFor ( int  $object_id,
?string  $type = null 
)

Definition at line 39 of file class.ilObjectPropertiesAgregator.php.

40  {
41  $core_properties = $this->core_properties_repository->getFor($object_id, $type);
42 
43  return new ilObjectProperties(
44  $core_properties,
45  $this->core_properties_repository,
46  $this->additional_properties_repository->getFor($object_id),
47  $this->additional_properties_repository,
48  $this->lom_services
49  );
50  }

◆ preload()

ilObjectPropertiesAgregator::preload ( array  $object_ids)

Definition at line 52 of file class.ilObjectPropertiesAgregator.php.

References ilObject\_lookupType().

52  : void
53  {
54  $this->core_properties_repository->preload($object_ids);
55  $objects_by_type = [];
56  foreach ($object_ids as $obj_id) {
57  $type = ilObject::_lookupType($obj_id);
58 
59  if (!array_key_exists($type, $objects_by_type)) {
60  $objects_by_type[$type] = [];
61  }
62  $objects_by_type[$type][] = $obj_id;
63  }
64 
65  foreach ($objects_by_type as $type => $obj_ids) {
66  $this->object_type_specific_properties_factory->getForObjectTypeString($type)?->preload($obj_ids);
67  }
68  }
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: