ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilNoVersionDowngradeConditionObjective Class Reference
+ Inheritance diagram for ilNoVersionDowngradeConditionObjective:
+ Collaboration diagram for ilNoVersionDowngradeConditionObjective:

Public Member Functions

 __construct (Data\Factory $data_factory)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Attributes

Data Factory $data_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilNoVersionDowngradeConditionObjective::__construct ( Data\Factory  $data_factory)

Definition at line 28 of file class.ilNoVersionDowngradeConditionObjective.php.

References $data_factory.

29  {
30  $this->data_factory = $data_factory;
31  }

Member Function Documentation

◆ achieve()

ilNoVersionDowngradeConditionObjective::achieve ( Setup\Environment  $environment)

Definition at line 58 of file class.ilNoVersionDowngradeConditionObjective.php.

References $factory, ILIAS\LTI\ToolProvider\$settings, ilVersionWrittenToSettingsObjective\ILIAS_VERSION_KEY, and ILIAS_VERSION_NUMERIC.

58  : Setup\Environment
59  {
60  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
61  $settings = $factory->settingsFor("common");
62 
63  $current_version = $this->data_factory->version($settings->get(ilVersionWrittenToSettingsObjective::ILIAS_VERSION_KEY));
64  $target_version = $this->data_factory->version(ILIAS_VERSION_NUMERIC);
65 
66  if ($target_version->isSmallerThan($current_version)) {
67  throw new Setup\NotExecutableException(
68  "Downgrades of versions may not be performed, you are running " .
69  "$current_version and target $target_version"
70  );
71  }
72 
73  return $environment;
74  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
const ILIAS_VERSION_NUMERIC
$factory
Definition: metadata.php:75

◆ getHash()

ilNoVersionDowngradeConditionObjective::getHash ( )

Definition at line 33 of file class.ilNoVersionDowngradeConditionObjective.php.

33  : string
34  {
35  return hash(
36  "sha256",
37  get_class($this)
38  );
39  }

◆ getLabel()

ilNoVersionDowngradeConditionObjective::getLabel ( )

Definition at line 41 of file class.ilNoVersionDowngradeConditionObjective.php.

41  : string
42  {
43  return "No downgrade is performed.";
44  }

◆ getPreconditions()

ilNoVersionDowngradeConditionObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilNoVersionDowngradeConditionObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 76 of file class.ilNoVersionDowngradeConditionObjective.php.

76  : bool
77  {
78  return true;
79  }

◆ isNotable()

ilNoVersionDowngradeConditionObjective::isNotable ( )

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

46  : bool
47  {
48  return true;
49  }

Field Documentation

◆ $data_factory

Data Factory ilNoVersionDowngradeConditionObjective::$data_factory
protected

Definition at line 26 of file class.ilNoVersionDowngradeConditionObjective.php.

Referenced by __construct().


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