ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilNoMajorVersionSkippedConditionObjective Class Reference
+ Inheritance diagram for ilNoMajorVersionSkippedConditionObjective:
+ Collaboration diagram for ilNoMajorVersionSkippedConditionObjective:

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()

ilNoMajorVersionSkippedConditionObjective::__construct ( Data\Factory  $data_factory)

Member Function Documentation

◆ achieve()

ilNoMajorVersionSkippedConditionObjective::achieve ( Setup\Environment  $environment)

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

58 : Setup\Environment
59 {
60 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
61 $settings = $factory->settingsFor("common");
62
63 $current_version_string = $settings->get(ilVersionWrittenToSettingsObjective::ILIAS_VERSION_KEY);
64 $current_version = $this->data_factory->version($current_version_string);
65 $target_version = $this->data_factory->version(ILIAS_VERSION_NUMERIC);
66
67 if (($target_version->getMajor() - $current_version->getMajor()) > 1) {
68 throw new Setup\NotExecutableException(
69 "Updates may only be performed from one major version to the " .
70 "next, no major versions may be skipped."
71 );
72 }
73
74 return $environment;
75 }
const ILIAS_VERSION_NUMERIC

References ILIAS\Setup\Environment\getResource(), ilVersionWrittenToSettingsObjective\ILIAS_VERSION_KEY, and ILIAS_VERSION_NUMERIC.

+ Here is the call graph for this function:

◆ getHash()

ilNoMajorVersionSkippedConditionObjective::getHash ( )

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

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

◆ getLabel()

ilNoMajorVersionSkippedConditionObjective::getLabel ( )

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

41 : string
42 {
43 return "No major version is skipped in update.";
44 }

◆ getPreconditions()

ilNoMajorVersionSkippedConditionObjective::getPreconditions ( Setup\Environment  $environment)

◆ isApplicable()

ilNoMajorVersionSkippedConditionObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 77 of file class.ilNoMajorVersionSkippedConditionObjective.php.

77 : bool
78 {
79 return true;
80 }

◆ isNotable()

ilNoMajorVersionSkippedConditionObjective::isNotable ( )

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

46 : bool
47 {
48 return true;
49 }

Field Documentation

◆ $data_factory

Data Factory ilNoMajorVersionSkippedConditionObjective::$data_factory
protected

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

Referenced by __construct().


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