ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTableLock Class Reference

Class ilTableLock. More...

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

Public Member Functions

 __construct ($table_name, ilDBInterface $ilDBInterface)
 ilTableLock constructor. More...
 
 check ()
 
 lockSequence ($lock_bool)
 
 aliasName ($alias_name)
 
 getTableName ()
 
 setTableName ($table_name)
 
 isLockSequence ()
 
 setLockSequence ($lock_sequence)
 
 getAlias ()
 
 setAlias ($alias)
 
 getLockLevel ()
 
 setLockLevel ($lock_level)
 
 isChecked ()
 
 setChecked ($checked)
 
 lockSequence ($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 ($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

 $table_name = ''
 
 $lock_sequence = false
 
 $alias = ''
 
 $lock_level = ilAtomQuery::LOCK_WRITE
 
 $checked = false
 
 $ilDBInstance
 

Detailed Description

Class ilTableLock.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

ilTableLock constructor.

Parameters
string$table_name

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

43 {
44 $this->table_name = $table_name;
45 $this->ilDBInstance = $ilDBInterface;
46 }

References $table_name.

Member Function Documentation

◆ aliasName()

ilTableLock::aliasName (   $alias_name)
Parameters
$alias_name
Returns
$this

Implements ilTableLockInterface.

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

82 {
83 $this->setAlias($alias_name);
84
85 return $this;
86 }

References setAlias().

+ Here is the call graph for this function:

◆ check()

ilTableLock::check ( )
Exceptions

ilAtomQueryException

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

53 {
54 if (!in_array($this->getLockLevel(), array( ilAtomQuery::LOCK_READ, ilAtomQuery::LOCK_WRITE ))) {
56 }
57 if (!$this->getTableName() || !$this->ilDBInstance->tableExists($this->getTableName())) {
59 }
60
61 $this->setChecked(true);
62 }
Class ilAtomQueryException.
setChecked($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 ( )
Returns
string

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

129 {
130 return $this->alias;
131 }

References $alias.

◆ getLockLevel()

ilTableLock::getLockLevel ( )
Returns
int

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

147 {
148 return $this->lock_level;
149 }

References $lock_level.

Referenced by check().

+ Here is the caller graph for this function:

◆ getTableName()

ilTableLock::getTableName ( )
Returns
string

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

93 {
94 return $this->table_name;
95 }

References $table_name.

Referenced by check().

+ Here is the caller graph for this function:

◆ isChecked()

ilTableLock::isChecked ( )
Returns
boolean

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

165 {
166 return $this->checked;
167 }

References $checked.

◆ isLockSequence()

ilTableLock::isLockSequence ( )
Returns
boolean

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

111 {
113 }

References $lock_sequence.

◆ lockSequence()

ilTableLock::lockSequence (   $lock_bool)
Parameters
bool$lock_bool
Returns
$this

Implements ilTableLockInterface.

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

70 {
71 $this->setLockSequence($lock_bool);
72
73 return $this;
74 }
setLockSequence($lock_sequence)

References setLockSequence().

+ Here is the call graph for this function:

◆ setAlias()

ilTableLock::setAlias (   $alias)
Parameters
string$alias

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

138 {
139 $this->alias = $alias;
140 }

References $alias.

Referenced by aliasName().

+ Here is the caller graph for this function:

◆ setChecked()

ilTableLock::setChecked (   $checked)
Parameters
boolean$checked

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

174 {
175 $this->checked = $checked;
176 }

References $checked.

Referenced by check().

+ Here is the caller graph for this function:

◆ setLockLevel()

ilTableLock::setLockLevel (   $lock_level)
Parameters
int$lock_level

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

156 {
157 $this->lock_level = $lock_level;
158 }

References $lock_level.

◆ setLockSequence()

ilTableLock::setLockSequence (   $lock_sequence)
Parameters
boolean$lock_sequence

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

120 {
121 $this->lock_sequence = $lock_sequence;
122 }

References $lock_sequence.

Referenced by lockSequence().

+ Here is the caller graph for this function:

◆ setTableName()

ilTableLock::setTableName (   $table_name)
Parameters
string$table_name

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

102 {
103 $this->table_name = $table_name;
104 }

References $table_name.

Field Documentation

◆ $alias

ilTableLock::$alias = ''
protected

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

Referenced by getAlias(), and setAlias().

◆ $checked

ilTableLock::$checked = false
protected

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

Referenced by isChecked(), and setChecked().

◆ $ilDBInstance

ilTableLock::$ilDBInstance
protected

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

◆ $lock_level

ilTableLock::$lock_level = ilAtomQuery::LOCK_WRITE
protected

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

Referenced by getLockLevel(), and setLockLevel().

◆ $lock_sequence

ilTableLock::$lock_sequence = false
protected

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

Referenced by isLockSequence(), and setLockSequence().

◆ $table_name

ilTableLock::$table_name = ''
protected

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

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


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