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

Public Member Functions

 getLatestStepNumber (string $step_class_name, string $step_prefix)
 Get the number of the latest database step in this class. More...
 
 readStepNumbers (string $step_class_name, string $step_prefix)
 Get a list of all steps in this class. More...
 

Detailed Description

Definition at line 21 of file class.ilDBStepReader.php.

Member Function Documentation

◆ getLatestStepNumber()

ilDBStepReader::getLatestStepNumber ( string  $step_class_name,
string  $step_prefix 
)

Get the number of the latest database step in this class.

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

26 : int
27 {
28 $steps = $this->readStepNumbers($step_class_name, $step_prefix);
29 return $steps[count($steps) - 1];
30 }
readStepNumbers(string $step_class_name, string $step_prefix)
Get a list of all steps in this class.

References readStepNumbers().

+ Here is the call graph for this function:

◆ readStepNumbers()

ilDBStepReader::readStepNumbers ( string  $step_class_name,
string  $step_prefix 
)

Get a list of all steps in this class.

Definition at line 35 of file class.ilDBStepReader.php.

35 : array
36 {
37 $step_numbers = [];
38 foreach (get_class_methods($step_class_name) as $method) {
39 if (stripos($method, $step_prefix) !== 0) {
40 continue;
41 }
42
43 $number = substr($method, strlen($step_prefix));
44
45 if (!preg_match("/^[1-9]\d*$/", $number)) {
46 throw new LogicException("Method $method seems to be a step but has an odd looking number");
47 }
48
49 $step_numbers[] = (int) $number;
50 }
51
52 sort($step_numbers);
53 return $step_numbers;
54 }

References ILIAS\Repository\int(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

Referenced by getLatestStepNumber().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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