ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTableLock Class Reference

Class ilTableLock. More...

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

Public Member Functions

 __construct (protected string $table_name, protected \ilDBInterface $ilDBInstance)
 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

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

Detailed Description

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 ( protected string  $table_name,
protected \ilDBInterface  $ilDBInstance 
)

ilTableLock constructor.

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

36  {
37  }

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 61 of file class.ilTableLock.php.

References setAlias().

62  {
63  $this->setAlias($alias_name);
64 
65  return $this;
66  }
setAlias(string $alias)
Class ilTableLockInterface Defines methods, which a Table-Lock used in ilAtomQuery provides...
+ Here is the call graph for this function:

◆ check()

ilTableLock::check ( )
Exceptions

Definition at line 42 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().

42  : void
43  {
44  if (!in_array($this->getLockLevel(), [ilAtomQuery::LOCK_READ, ilAtomQuery::LOCK_WRITE], true)) {
46  }
47  if (!$this->getTableName() || !$this->ilDBInstance->tableExists($this->getTableName())) {
49  }
50 
51  $this->setChecked(true);
52  }
Class ilAtomQueryException.
setChecked(bool $checked)
+ Here is the call graph for this function:

◆ getAlias()

ilTableLock::getAlias ( )

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

References $alias.

88  : string
89  {
90  return $this->alias;
91  }

◆ getLockLevel()

ilTableLock::getLockLevel ( )

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

References $lock_level.

Referenced by check().

98  : int
99  {
100  return $this->lock_level;
101  }
+ Here is the caller graph for this function:

◆ getTableName()

ilTableLock::getTableName ( )

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

Referenced by check().

68  : string
69  {
70  return $this->table_name;
71  }
+ Here is the caller graph for this function:

◆ isChecked()

ilTableLock::isChecked ( )

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

References $checked.

108  : bool
109  {
110  return $this->checked;
111  }

◆ isLockSequence()

ilTableLock::isLockSequence ( )

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

References $lock_sequence.

78  : bool
79  {
80  return $this->lock_sequence;
81  }

◆ 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 54 of file class.ilTableLock.php.

References setLockSequence().

55  {
56  $this->setLockSequence($lock_bool);
57 
58  return $this;
59  }
setLockSequence(bool $lock_sequence)
Class ilTableLockInterface Defines methods, which a Table-Lock used in ilAtomQuery provides...
+ Here is the call graph for this function:

◆ setAlias()

ilTableLock::setAlias ( string  $alias)

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

References $alias.

Referenced by aliasName().

93  : void
94  {
95  $this->alias = $alias;
96  }
+ Here is the caller graph for this function:

◆ setChecked()

ilTableLock::setChecked ( bool  $checked)

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

References $checked.

Referenced by check().

113  : void
114  {
115  $this->checked = $checked;
116  }
+ Here is the caller graph for this function:

◆ setLockLevel()

ilTableLock::setLockLevel ( int  $lock_level)

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

References $lock_level.

103  : void
104  {
105  $this->lock_level = $lock_level;
106  }

◆ setLockSequence()

ilTableLock::setLockSequence ( bool  $lock_sequence)

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

References $lock_sequence.

Referenced by lockSequence().

83  : void
84  {
85  $this->lock_sequence = $lock_sequence;
86  }
+ Here is the caller graph for this function:

◆ setTableName()

ilTableLock::setTableName ( string  $table_name)

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

73  : void
74  {
75  $this->table_name = $table_name;
76  }

Field Documentation

◆ $alias

string ilTableLock::$alias = ''
protected

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

Referenced by getAlias(), and setAlias().

◆ $checked

bool ilTableLock::$checked = false
protected

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

Referenced by isChecked(), and setChecked().

◆ $lock_level

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

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

Referenced by getLockLevel(), and setLockLevel().

◆ $lock_sequence

bool ilTableLock::$lock_sequence = false
protected

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

Referenced by isLockSequence(), and setLockSequence().


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