ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTableLock Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTableLock:
+ Collaboration diagram for ilTableLock:

Public Member Functions

 __construct (string $table_name, ilDBInterface $ilDBInterface)
 ilTableLock constructor. More...
 
 check ()
 
 lockSequence (bool $lock_bool)
 Set true/false whether you would like to lock an existing sequence-table, too Without lockSequence(true) sequences are not locked. More...
 
 aliasName (string $alias_name)
 If you use Alias' in your Queries which have to be locked by ilAtomQuery, "LOCK TABLE" needs to lock both of the original table and the alias-table. More...
 
 getTableName ()
 
 setTableName (string $table_name)
 
 isLockSequence ()
 
 setLockSequence (bool $lock_sequence)
 
 getAlias ()
 
 setAlias (string $alias)
 
 getLockLevel ()
 
 setLockLevel (int $lock_level)
 
 isChecked ()
 
 setChecked (bool $checked)
 

Protected Attributes

string $table_name = ''
 
bool $lock_sequence = false
 
string $alias = ''
 
int $lock_level = ilAtomQuery::LOCK_WRITE
 
bool $checked = false
 
ilDBInterface $ilDBInstance
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTableLock

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Constructor & Destructor Documentation

◆ __construct()

ilTableLock::__construct ( string  $table_name,
ilDBInterface  $ilDBInterface 
)

ilTableLock constructor.

Definition at line 37 of file class.ilTableLock.php.

References $table_name.

38  {
39  $this->table_name = $table_name;
40  $this->ilDBInstance = $ilDBInterface;
41  }

Member Function Documentation

◆ aliasName()

ilTableLock::aliasName ( string  $alias_name)

If you use Alias' in your Queries which have to be locked by ilAtomQuery, "LOCK TABLE" needs to lock both of the original table and the alias-table.

Provide the name of your alias here

Implements ilTableLockInterface.

Definition at line 65 of file class.ilTableLock.php.

References setAlias().

66  {
67  $this->setAlias($alias_name);
68 
69  return $this;
70  }
setAlias(string $alias)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ check()

ilTableLock::check ( )
Exceptions

Definition at line 46 of file class.ilTableLock.php.

References ilAtomQueryException\DB_ATOM_LOCK_TABLE_NONEXISTING, ilAtomQueryException\DB_ATOM_LOCK_WRONG_LEVEL, getLockLevel(), getTableName(), ilAtomQuery\LOCK_READ, ilAtomQuery\LOCK_WRITE, and setChecked().

46  : void
47  {
48  if (!in_array($this->getLockLevel(), [ilAtomQuery::LOCK_READ, ilAtomQuery::LOCK_WRITE], true)) {
50  }
51  if (!$this->getTableName() || !$this->ilDBInstance->tableExists($this->getTableName())) {
53  }
54 
55  $this->setChecked(true);
56  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setChecked(bool $checked)
+ Here is the call graph for this function:

◆ getAlias()

ilTableLock::getAlias ( )

Definition at line 92 of file class.ilTableLock.php.

References $alias.

92  : string
93  {
94  return $this->alias;
95  }

◆ getLockLevel()

ilTableLock::getLockLevel ( )

Definition at line 102 of file class.ilTableLock.php.

References $lock_level.

Referenced by check().

102  : int
103  {
104  return $this->lock_level;
105  }
+ Here is the caller graph for this function:

◆ getTableName()

ilTableLock::getTableName ( )

Definition at line 72 of file class.ilTableLock.php.

References $table_name.

Referenced by check().

72  : string
73  {
74  return $this->table_name;
75  }
+ Here is the caller graph for this function:

◆ isChecked()

ilTableLock::isChecked ( )

Definition at line 112 of file class.ilTableLock.php.

References $checked.

112  : bool
113  {
114  return $this->checked;
115  }

◆ isLockSequence()

ilTableLock::isLockSequence ( )

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

References $lock_sequence.

82  : bool
83  {
84  return $this->lock_sequence;
85  }

◆ lockSequence()

ilTableLock::lockSequence ( bool  $lock_bool)

Set true/false whether you would like to lock an existing sequence-table, too Without lockSequence(true) sequences are not locked.

Implements ilTableLockInterface.

Definition at line 58 of file class.ilTableLock.php.

References setLockSequence().

59  {
60  $this->setLockSequence($lock_bool);
61 
62  return $this;
63  }
setLockSequence(bool $lock_sequence)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ setAlias()

ilTableLock::setAlias ( string  $alias)

Definition at line 97 of file class.ilTableLock.php.

References $alias.

Referenced by aliasName().

97  : void
98  {
99  $this->alias = $alias;
100  }
+ Here is the caller graph for this function:

◆ setChecked()

ilTableLock::setChecked ( bool  $checked)

Definition at line 117 of file class.ilTableLock.php.

References $checked.

Referenced by check().

117  : void
118  {
119  $this->checked = $checked;
120  }
+ Here is the caller graph for this function:

◆ setLockLevel()

ilTableLock::setLockLevel ( int  $lock_level)

Definition at line 107 of file class.ilTableLock.php.

References $lock_level.

107  : void
108  {
109  $this->lock_level = $lock_level;
110  }

◆ setLockSequence()

ilTableLock::setLockSequence ( bool  $lock_sequence)

Definition at line 87 of file class.ilTableLock.php.

References $lock_sequence.

Referenced by lockSequence().

87  : void
88  {
89  $this->lock_sequence = $lock_sequence;
90  }
+ Here is the caller graph for this function:

◆ setTableName()

ilTableLock::setTableName ( string  $table_name)

Definition at line 77 of file class.ilTableLock.php.

References $table_name.

77  : void
78  {
79  $this->table_name = $table_name;
80  }

Field Documentation

◆ $alias

string ilTableLock::$alias = ''
protected

Definition at line 29 of file class.ilTableLock.php.

Referenced by getAlias(), and setAlias().

◆ $checked

bool ilTableLock::$checked = false
protected

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

Referenced by isChecked(), and setChecked().

◆ $ilDBInstance

ilDBInterface ilTableLock::$ilDBInstance
protected

Definition at line 32 of file class.ilTableLock.php.

◆ $lock_level

int ilTableLock::$lock_level = ilAtomQuery::LOCK_WRITE
protected

Definition at line 30 of file class.ilTableLock.php.

Referenced by getLockLevel(), and setLockLevel().

◆ $lock_sequence

bool ilTableLock::$lock_sequence = false
protected

Definition at line 28 of file class.ilTableLock.php.

Referenced by isLockSequence(), and setLockSequence().

◆ $table_name

string ilTableLock::$table_name = ''
protected

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

Referenced by __construct(), getTableName(), and setTableName().


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