ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebResourceDBUpdateSteps Class Reference

General purpose update steps for weblinks. More...

+ Inheritance diagram for ilWebResourceDBUpdateSteps:
+ Collaboration diagram for ilWebResourceDBUpdateSteps:

Public Member Functions

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

Protected Attributes

ilDBInterface $db
 

Detailed Description

General purpose update steps for weblinks.

Author
Tim Schmitz schmi.nosp@m.tz@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilWebResourceDBUpdateSteps.php.

Member Function Documentation

◆ prepare()

ilWebResourceDBUpdateSteps::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 29 of file class.ilWebResourceDBUpdateSteps.php.

References $db.

29  : void
30  {
31  $this->db = $db;
32  }

◆ step_1()

ilWebResourceDBUpdateSteps::step_1 ( )

Definition at line 34 of file class.ilWebResourceDBUpdateSteps.php.

34  : void
35  {
36  // Add index
37  if (!$this->db->indexExistsByFields('webr_items', ['webr_id'])) {
38  $this->db->addIndex('webr_items', ['webr_id'], 'i3');
39  }
40  }

◆ step_2()

ilWebResourceDBUpdateSteps::step_2 ( )

Definition at line 42 of file class.ilWebResourceDBUpdateSteps.php.

42  : void
43  {
44  // Add combined index
45  // 32201
46  if (
47  $this->db->tableExists('webr_items') &&
48  !$this->db->indexExistsByFields('webr_items', ['webr_id', 'active'])
49  ) {
50  $this->db->addIndex('webr_items', ['webr_id', 'active'], 'i4');
51  }
52  }

Field Documentation

◆ $db

ilDBInterface ilWebResourceDBUpdateSteps::$db
protected

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

Referenced by prepare().


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