ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
StandardRepositoryPreloader.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
31
37{
44
45 public function __construct(Repositories $repositories)
46 {
47 $this->resource_repository = $repositories->getResourceRepository();
48 $this->revision_repository = $repositories->getRevisionRepository();
49 $this->information_repository = $repositories->getInformationRepository();
50 $this->stakeholder_repository = $repositories->getStakeholderRepository();
51 $this->flavour_repository = $repositories->getFlavourRepository();
52 $this->collection_repository = $repositories->getCollectionRepository();
53 }
54
55 public function preload(array $identification_strings): void
56 {
57 $this->resource_repository->preload($identification_strings);
58 $this->revision_repository->preload($identification_strings);
59 $this->information_repository->preload($identification_strings);
60 $this->stakeholder_repository->preload($identification_strings);
61 $this->flavour_repository->preload($identification_strings);
62 }
63
67 public function preloadCollections(array $collection_identification_strings): void
68 {
69 if ($collection_identification_strings === []) {
70 return;
71 }
72 $resource_ids = $this->collection_repository->getResourceIdsForCollections($collection_identification_strings);
73 $resource_ids = array_values(array_unique(
74 array_map(static fn(ResourceIdentification $id) => $id->serialize(), $resource_ids)
75 ));
76
77 if ($resource_ids === []) {
78 return;
79 }
80
81 $this->preload($resource_ids);
82 }
83}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23