ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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 43 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

References ILIAS\Setup\Environment\getResource().

43  : Environment
44  {
45  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
46 
47  $db->update(
48  'rbac_operations',
49  ['op_order' => ["integer", $this->pos]],
50  ["operation" => ["text", $this->operation]]
51  );
52 
53  return $environment;
54  }
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 21 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

21  : string
22  {
23  return hash("sha256", self::class);
24  }

◆ getLabel()

ilAccessRBACOperationOrderUpdatedObjective::getLabel ( )

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

26  : string
27  {
28  return "Update operation order (operation=$this->operation;pos=$this->pos)";
29  }

◆ getPreconditions()

ilAccessRBACOperationOrderUpdatedObjective::getPreconditions ( Environment  $environment)

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

36  : array
37  {
38  return [
40  ];
41  }

◆ isApplicable()

ilAccessRBACOperationOrderUpdatedObjective::isApplicable ( Environment  $environment)

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

References ILIAS\Setup\Environment\getResource().

56  : bool
57  {
58  $db = $environment->getResource(Environment::RESOURCE_DATABASE);
59 
60  $sql =
61  "SELECT ops_id" . PHP_EOL
62  . "FROM rbac_operations" . PHP_EOL
63  . "WHERE operation = " . $db->quote($this->operation, "text") . PHP_EOL
64  ;
65 
66  return $db->numRows($db->query($sql)) == 1;
67  }
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 31 of file class.ilAccessRBACOperationOrderUpdatedObjective.php.

31  : bool
32  {
33  return true;
34  }

Field Documentation

◆ $operation

string ilAccessRBACOperationOrderUpdatedObjective::$operation
protected

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

Referenced by __construct().

◆ $pos

int ilAccessRBACOperationOrderUpdatedObjective::$pos
protected

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

Referenced by __construct().


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