ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilComponentRepositoryExistsObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Setup;
22
24{
28 public function getHash(): string
29 {
30 return hash("sha256", self::class);
31 }
32
36 public function getLabel(): string
37 {
38 return "ilComponentRepository (with database) is initialized and stored into the environment.";
39 }
40
44 public function isNotable(): bool
45 {
46 return true;
47 }
48
52 public function getPreconditions(Setup\Environment $environment): array
53 {
54 return [
56 ];
57 }
58
62 public function achieve(Setup\Environment $environment): Setup\Environment
63 {
64 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
65
66 $data_factory = new ILIAS\Data\Factory();
67 $component_repository = new ilArtifactComponentRepository(
68 $data_factory,
70 $data_factory,
71 $db
72 ),
73 $data_factory->version(ILIAS_VERSION_NUMERIC)
74 );
75
76 return $environment->withResource(
77 Setup\Environment::RESOURCE_COMPONENT_REPOSITORY,
78 $component_repository
79 );
80 }
81
85 public function isApplicable(Setup\Environment $environment): bool
86 {
87 return is_null($environment->getResource(Setup\Environment::RESOURCE_COMPONENT_REPOSITORY));
88 }
89}
Builds data types.
Definition: Factory.php:36
Repository for component data implemented over artifacts.
isApplicable(Setup\Environment $environment)
@inheritDoc
Implementation of ilPluginStateDB over ilDBInterface.
const ILIAS_VERSION_NUMERIC
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...