ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilAccessRBACDeleteDbkSteps Class Reference
+ Inheritance diagram for ilAccessRBACDeleteDbkSteps:
+ Collaboration diagram for ilAccessRBACDeleteDbkSteps:

Public Member Functions

 prepare (\ilDBInterface $db)
 Prepare the execution of the steps. More...
 
 step_1 ()
 
 step_2 ()
 
 step_3 ()
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Member Function Documentation

◆ prepare()

ilAccessRBACDeleteDbkSteps::prepare ( \ilDBInterface  $db)

Prepare the execution of the steps.

Do not use anything from the globals or the DIC inside your steps, only use the instance of the database provided here.

Implements ilDatabaseUpdateSteps.

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

References $db.

26  : void
27  {
28  $this->db = $db;
29  }

◆ step_1()

ilAccessRBACDeleteDbkSteps::step_1 ( )

Definition at line 31 of file class.ilAccessRBACDeleteDbkSteps.php.

31  : void
32  {
33  //Delete all entries with type digibook from rbac_ta
34  $sql =
35  "DELETE FROM rbac_ta " .
36  "WHERE typ_id IN (" .
37  "SELECT obj_id FROM object_data " .
38  "WHERE type = 'typ' " .
39  "AND title = 'dbk'" .
40  ")";
41 
42  $this->db->manipulate($sql);
43 
44  //Delete the entry of the digibook type from object_data
45  $sql =
46  "DELETE FROM object_data " .
47  "WHERE type = 'typ' " .
48  "AND title = 'dbk'";
49 
50  $this->db->manipulate($sql);
51  }

◆ step_2()

ilAccessRBACDeleteDbkSteps::step_2 ( )

Definition at line 53 of file class.ilAccessRBACDeleteDbkSteps.php.

53  : void
54  {
55  //Delete every row with the ops_id of the digibook create operation from the rbac tables
56  $sql =
57  "DELETE FROM rbac_ta " .
58  "WHERE ops_id IN (" .
59  "SELECT ops_id FROM rbac_operations " .
60  "WHERE operation = 'create_dbk'" .
61  ")";
62 
63  $this->db->manipulate($sql);
64 
65  $sql =
66  "DELETE FROM rbac_templates " .
67  "WHERE ops_id IN (" .
68  "SELECT ops_id FROM rbac_operations " .
69  "WHERE operation = 'create_dbk'" .
70  ")";
71 
72  $this->db->manipulate($sql);
73 
74  //Delete the operation from rbac_operations
75  $sql =
76  "DELETE FROM rbac_operations " .
77  "WHERE operation = 'create_dbk'";
78 
79  $this->db->manipulate($sql);
80  }

◆ step_3()

ilAccessRBACDeleteDbkSteps::step_3 ( )

Definition at line 82 of file class.ilAccessRBACDeleteDbkSteps.php.

82  : void
83  {
84  //Delete all other rows in the rbac tables which refer to the type dbk
85  $sql =
86  "DELETE FROM rbac_templates " .
87  "WHERE type = 'dbk' "
88  ;
89 
90  $this->db->manipulate($sql);
91  }

Field Documentation

◆ $db

ilDBInterface ilAccessRBACDeleteDbkSteps::$db
protected

Definition at line 24 of file class.ilAccessRBACDeleteDbkSteps.php.

Referenced by prepare().


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