ILIAS  release_8 Revision v8.24
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)
 
 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...
 

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.

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

References $table_name.

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.

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...

References setAlias().

+ Here is the call graph for this function:

◆ check()

ilTableLock::check ( )
Exceptions

ilAtomQueryException

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

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)

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

+ Here is the call graph for this function:

◆ getAlias()

ilTableLock::getAlias ( )

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

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

References $alias.

◆ getLockLevel()

ilTableLock::getLockLevel ( )

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

102 : int
103 {
104 return $this->lock_level;
105 }

References $lock_level.

Referenced by check().

+ Here is the caller graph for this function:

◆ getTableName()

ilTableLock::getTableName ( )

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

72 : string
73 {
74 return $this->table_name;
75 }

References $table_name.

Referenced by check().

+ Here is the caller graph for this function:

◆ isChecked()

ilTableLock::isChecked ( )

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

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

References $checked.

◆ isLockSequence()

ilTableLock::isLockSequence ( )

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

82 : bool
83 {
85 }

References $lock_sequence.

◆ 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.

59 {
60 $this->setLockSequence($lock_bool);
61
62 return $this;
63 }
setLockSequence(bool $lock_sequence)

References setLockSequence().

+ Here is the call graph for this function:

◆ setAlias()

ilTableLock::setAlias ( string  $alias)

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

97 : void
98 {
99 $this->alias = $alias;
100 }

References $alias.

Referenced by aliasName().

+ Here is the caller graph for this function:

◆ setChecked()

ilTableLock::setChecked ( bool  $checked)

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

117 : void
118 {
119 $this->checked = $checked;
120 }

References $checked.

Referenced by check().

+ Here is the caller graph for this function:

◆ setLockLevel()

ilTableLock::setLockLevel ( int  $lock_level)

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

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

References $lock_level.

◆ setLockSequence()

ilTableLock::setLockSequence ( bool  $lock_sequence)

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

87 : void
88 {
89 $this->lock_sequence = $lock_sequence;
90 }

References $lock_sequence.

Referenced by lockSequence().

+ Here is the caller graph for this function:

◆ setTableName()

ilTableLock::setTableName ( string  $table_name)

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

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

References $table_name.

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: