ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAccessRBACOperationOrderUpdatedObjective Class Reference
+ Inheritance diagram for ilAccessRBACOperationOrderUpdatedObjective:
+ Collaboration diagram for ilAccessRBACOperationOrderUpdatedObjective:

Public Member Functions

 __construct (string $operation, int $pos)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 
 isApplicable (Environment $environment)
 

Protected Attributes

string $operation
 
int $pos
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAccessRBACOperationOrderUpdatedObjective::__construct ( string  $operation,
int  $pos 
)

Member Function Documentation

◆ achieve()

ilAccessRBACOperationOrderUpdatedObjective::achieve ( Environment  $environment)

Definition at line 57 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

References ILIAS\Setup\Environment\getResource().

57  : Environment
58  {
59  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
60 
61  $db->update(
62  'rbac_operations',
63  ['op_order' => ["integer", $this->pos]],
64  ["operation" => ["text", $this->operation]]
65  );
66 
67  return $environment;
68  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
+ Here is the call graph for this function:

◆ getHash()

ilAccessRBACOperationOrderUpdatedObjective::getHash ( )

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

35  : string
36  {
37  return hash("sha256", self::class);
38  }

◆ getLabel()

ilAccessRBACOperationOrderUpdatedObjective::getLabel ( )

Definition at line 40 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

40  : string
41  {
42  return "Update operation order (operation=$this->operation;pos=$this->pos)";
43  }

◆ getPreconditions()

ilAccessRBACOperationOrderUpdatedObjective::getPreconditions ( Environment  $environment)

Definition at line 50 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

50  : array
51  {
52  return [
54  ];
55  }

◆ isApplicable()

ilAccessRBACOperationOrderUpdatedObjective::isApplicable ( Environment  $environment)

Definition at line 70 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

References ILIAS\Setup\Environment\getResource().

70  : bool
71  {
72  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
73 
74  $sql =
75  "SELECT ops_id" . PHP_EOL
76  . "FROM rbac_operations" . PHP_EOL
77  . "WHERE operation = " . $db->quote($this->operation, "text") . PHP_EOL
78  ;
79 
80  return $db->numRows($db->query($sql)) == 1;
81  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
+ Here is the call graph for this function:

◆ isNotable()

ilAccessRBACOperationOrderUpdatedObjective::isNotable ( )

Definition at line 45 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

45  : bool
46  {
47  return true;
48  }

Field Documentation

◆ $operation

string ilAccessRBACOperationOrderUpdatedObjective::$operation
protected

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

Referenced by __construct().

◆ $pos

int ilAccessRBACOperationOrderUpdatedObjective::$pos
protected

Definition at line 27 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

Referenced by __construct().


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