ILIAS
release_7 Revision v7.30-3-g800a261c036
|
This base-class simplifies the creation of (consecutive) database updates. More...
Public Member Functions | |
__construct (Objective $base) | |
getAdditionalPreconditionsForStep (int $num) | |
Get preconditions for steps. More... | |
getHash () | |
The hash for the objective is calculated over the classname and the steps that are contained. More... | |
getLabel () | |
Get a label that describes this objective. More... | |
isNotable () | |
@inheritdocs More... | |
getPreconditions (Environment $environment) | |
@inheritdocs More... | |
achieve (Environment $environment) | |
@inheritdocs More... | |
isApplicable (Environment $environment) | |
@inheritDoc More... | |
getStep (int $num, int $finished=0) | |
Get a database update step. More... | |
getLatestStepNum () | |
Get the number of latest database step in this class. More... | |
getHash () | |
Get a hash for this objective. More... | |
getLabel () | |
Get a label that describes this objective. More... | |
isNotable () | |
Get to know if this is an interesting objective for a human. More... | |
getPreconditions (Environment $environment) | |
Objectives might depend on other objectives. More... | |
achieve (Environment $environment) | |
Objectives can be achieved. More... | |
isApplicable (Environment $environment) | |
Get to know whether the objective is applicable. More... | |
Data Fields | |
const | STEP_METHOD_PREFIX = "step_" |
Protected Member Functions | |
getSteps () | |
Get the numbers of the steps in this class. More... | |
Protected Attributes | |
$steps = null | |
$base | |
This base-class simplifies the creation of (consecutive) database updates.
Implement update steps on one or more tables by creating methods that follow this schema:
public function step_1(\ilDBInterface $db) { ... }
The class will figure out which of them haven't been performed yet and need to be executed.
If the class takes care of only one table or a set of related tables it will be easier to maintain.
If for some reason you rely on other objectives, e.g. steps from other db-update classes, implement getAdditionalPreconditionsForStep
.
Definition at line 25 of file class.ilDatabaseUpdateSteps.php.
ilDatabaseUpdateSteps::__construct | ( | Objective | $base | ) |
Objective | $base | for the update steps, i.e. the objective that should have been reached before the steps of this class can even begin. Most probably this should be \ilDatabasePopulatedObjective. |
Definition at line 45 of file class.ilDatabaseUpdateSteps.php.
|
final |
@inheritdocs
Implements ILIAS\Setup\Objective.
Definition at line 108 of file class.ilDatabaseUpdateSteps.php.
ilDatabaseUpdateSteps::getAdditionalPreconditionsForStep | ( | int | $num | ) |
Get preconditions for steps.
The previous step will automatically be a precondition of every step but will not be returned from this method.
Reimplemented in Test_ilDatabaseUpdateSteps.
Definition at line 59 of file class.ilDatabaseUpdateSteps.php.
Referenced by getStep().
|
final |
The hash for the objective is calculated over the classname and the steps that are contained.
Implements ILIAS\Setup\Objective.
Definition at line 68 of file class.ilDatabaseUpdateSteps.php.
|
final |
Get a label that describes this objective.
Implements ILIAS\Setup\Objective.
Definition at line 76 of file class.ilDatabaseUpdateSteps.php.
|
final |
Get the number of latest database step in this class.
Definition at line 146 of file class.ilDatabaseUpdateSteps.php.
References getSteps().
Referenced by getPreconditions().
|
final |
@inheritdocs
Implements ILIAS\Setup\Objective.
Definition at line 92 of file class.ilDatabaseUpdateSteps.php.
References $log, getLatestStepNum(), ILIAS\Setup\Environment\getResource(), and getStep().
|
final |
Get a database update step.
Optionally tell which step is known to have been finished to exclude it from the preconditions of the newer steps.
LogicException if step is unknown
Definition at line 127 of file class.ilDatabaseUpdateSteps.php.
References $base, getAdditionalPreconditionsForStep(), and getSteps().
Referenced by getPreconditions().
|
finalprotected |
Get the numbers of the steps in this class.
Definition at line 157 of file class.ilDatabaseUpdateSteps.php.
References $steps.
Referenced by Test_ilDatabaseUpdateSteps\_getSteps(), getLatestStepNum(), and getStep().
|
final |
@inheritDoc
Implements ILIAS\Setup\Objective.
Definition at line 116 of file class.ilDatabaseUpdateSteps.php.
|
final |
@inheritdocs
Implements ILIAS\Setup\Objective.
Definition at line 84 of file class.ilDatabaseUpdateSteps.php.
|
protected |
Definition at line 37 of file class.ilDatabaseUpdateSteps.php.
Referenced by __construct(), and getStep().
|
protected |
Definition at line 32 of file class.ilDatabaseUpdateSteps.php.
Referenced by getSteps().
const ilDatabaseUpdateSteps::STEP_METHOD_PREFIX = "step_" |
Definition at line 27 of file class.ilDatabaseUpdateSteps.php.
Referenced by ilDatabaseUpdateStep\__construct().