2 require_once(
'./Services/Database/interfaces/interface.ilAtomQuery.php');
3 require_once(
'./Services/Database/classes/Atom/class.ilTableLock.php');
109 $ilTableLock =
new ilTableLock($table_name, $this->ilDBInstance);
111 $this->tables[] = $ilTableLock;
182 abstract public function run();
204 static::checkAnomaly($anomaly);
249 if (!in_array($anomalie, self::$possible_anomalies)) {
260 if ((is_array($this->query) && 0 === count($this->query))) {
263 foreach ($this->query as
$query) {
277 if (!is_callable($query)) {
280 if (is_array($query)) {
283 if (is_string($query)) {
286 $classname = get_class($query);
287 $is_a_closure = $classname ==
'Closure';
288 if (!$is_a_closure) {
290 foreach ($ref->getMethods() as $method) {
291 if ($method->getName() ==
'__invoke') {
299 $ref =
new ReflectionFunction($query);
300 $parameters = $ref->getParameters();
301 if (count($parameters) !== 1) {
304 $reflectionClass = $parameters[0]->getClass();
305 if ($reflectionClass && $reflectionClass->getName() ==
'ilDBInterface') {
319 protected function hasWriteLocks()
321 $has_write_locks =
false;
325 foreach ($this->tables as
$table) {
327 $has_write_locks =
true;
331 return $has_write_locks;
341 $query($this->ilDBInstance);
356 if (count($this->tables) === 0) {
const DB_ATOM_CLOSURE_NONE
static $possible_anomalies
const ISOLATION_SERIALIZABLE
const ANO_NON_REPEATED_READ
static checkAnomaly($anomalie)
const DB_ATOM_LOCK_WRONG_LEVEL
const ISOLATION_READ_COMMITED
const ISOLATION_REPEATED_READ
static $available_isolations_levels
const DB_ATOM_CLOSURE_WRONG_FORMAT
addQueryCallable(callable $query)
All action on the database during this isolation has to be passed as Callable to ilAtomQuery.
Class ilAtomQueryException.
const DB_ATOM_CLOSURE_ALREADY_SET
const DB_ATOM_ISO_WRONG_LEVEL
const DB_ATOM_LOCK_NO_TABLE
Create styles array
The data for the language used.
const DB_ATOM_ANO_NOT_AVAILABLE
addTableLock($table_name)
Add table-names which are influenced by your queries, MyISAm has to lock those tables.
checkCallable(callable $query)
static getPossibleAnomalies($isolation_level)
const ISOLATION_READ_UNCOMMITED
static checkIsolationLevel($isolation_level)
if(empty($password)) $table
static isThereRiskThat($isolation_level, $anomaly)
replaceQueryCallable(callable $query)
__construct(ilDBInterface $ilDBInstance, $isolation_level=ilAtomQuery::ISOLATION_SERIALIZABLE)
ilAtomQuery constructor.