ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAtomQuery Interface Reference

Interface ilAtomQuery. More...

+ Inheritance diagram for ilAtomQuery:
+ Collaboration diagram for ilAtomQuery:

Public Member Functions

 addTableLock ($table_name)
 Add table-names which are influenced by your queries, MyISAm has to lock those tables. More...
 
 addQueryCallable (callable $query)
 Every action on the database during this isolation has to be passed as Callable to ilAtomQuery. More...
 
 replaceQueryCallable (callable $query)
 Every action on the database during this isolation has to be passed as Callable to ilAtomQuery. More...
 
 run ()
 Fire your Queries. More...
 
 getIsolationLevel ()
 Returns the current Isolation-Level. More...
 
 checkCallable (callable $query)
 Provides a check if your callable is ready to be used in ilAtomQuery. More...
 

Static Public Member Functions

static checkIsolationLevel ($isolation_level)
 

Data Fields

const LOCK_WRITE = 1
 
const LOCK_READ = 2
 
const ISOLATION_READ_UNCOMMITED = 1
 
const ISOLATION_READ_COMMITED = 2
 
const ISOLATION_REPEATED_READ = 3
 
const ISOLATION_SERIALIZABLE = 4
 
const ANO_LOST_UPDATES = 1
 
const ANO_DIRTY_READ = 2
 
const ANO_NON_REPEATED_READ = 3
 
const ANO_PHANTOM = 4
 

Detailed Description

Interface ilAtomQuery.

Use ilAtomQuery to fire Database-Actions which have to be done without beeing influenced by other queries or which can influence other queries as well. Depending on the current Database-engine, this can be done by using transaction or with table-locks

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

Definition at line 12 of file interface.ilAtomQuery.php.

Member Function Documentation

◆ addQueryCallable()

ilAtomQuery::addQueryCallable ( callable  $query)

Every action on the database during this isolation has to be passed as Callable to ilAtomQuery.

An example (Closure): $ilAtomQuery->addQueryClosure( function (ilDBInterface $ilDB) use ($new_obj_id, $current_id) { $ilDB->doStuff(); });

An example (Callable Class): class ilMyAtomQueryClass { public function __invoke(ilDBInterface $ilDB) { $ilDB->doStuff(); } }

$ilAtomQuery->addQueryClosure(new ilMyAtomQueryClass());

Parameters
\Callable$query
Exceptions
ilAtomQueryException

Implemented in ilAtomQueryBase.

◆ addTableLock()

ilAtomQuery::addTableLock (   $table_name)

Add table-names which are influenced by your queries, MyISAm has to lock those tables.

You get an ilTableLockInterface with further possibilities, e.g.:

$ilAtomQuery->addTableLock('my_table')->lockSequence(true)->aliasName('my_alias');

the lock-level is determined by ilAtomQuery

Parameters
$table_name
Returns

Implemented in ilAtomQueryBase.

◆ checkCallable()

ilAtomQuery::checkCallable ( callable  $query)

Provides a check if your callable is ready to be used in ilAtomQuery.

Parameters
callable$query
Returns
bool

Implemented in ilAtomQueryBase.

◆ checkIsolationLevel()

static ilAtomQuery::checkIsolationLevel (   $isolation_level)
static
Parameters
$isolation_level
Exceptions

Implemented in ilAtomQueryBase.

◆ getIsolationLevel()

ilAtomQuery::getIsolationLevel ( )

Returns the current Isolation-Level.

Returns
int

Implemented in ilAtomQueryBase.

◆ replaceQueryCallable()

ilAtomQuery::replaceQueryCallable ( callable  $query)

Every action on the database during this isolation has to be passed as Callable to ilAtomQuery.

An example (Closure): $ilAtomQuery->addQueryClosure( function (ilDBInterface $ilDB) use ($new_obj_id, $current_id) { $ilDB->doStuff(); });

An example (Callable Class): class ilMyAtomQueryClass { public function __invoke(ilDBInterface $ilDB) { $ilDB->doStuff(); } }

$ilAtomQuery->addQueryClosure(new ilMyAtomQueryClass());

Parameters
\Callable$query
Exceptions
ilAtomQueryException

Implemented in ilAtomQueryBase.

◆ run()

ilAtomQuery::run ( )

Fire your Queries.

Exceptions

Implemented in ilAtomQueryBase, ilAtomQueryLock, and ilAtomQueryTransaction.

Field Documentation

◆ ANO_DIRTY_READ

const ilAtomQuery::ANO_DIRTY_READ = 2

Definition at line 24 of file interface.ilAtomQuery.php.

◆ ANO_LOST_UPDATES

const ilAtomQuery::ANO_LOST_UPDATES = 1

Definition at line 23 of file interface.ilAtomQuery.php.

◆ ANO_NON_REPEATED_READ

const ilAtomQuery::ANO_NON_REPEATED_READ = 3

Definition at line 25 of file interface.ilAtomQuery.php.

◆ ANO_PHANTOM

const ilAtomQuery::ANO_PHANTOM = 4

Definition at line 26 of file interface.ilAtomQuery.php.

◆ ISOLATION_READ_COMMITED

const ilAtomQuery::ISOLATION_READ_COMMITED = 2

◆ ISOLATION_READ_UNCOMMITED

const ilAtomQuery::ISOLATION_READ_UNCOMMITED = 1

◆ ISOLATION_REPEATED_READ

const ilAtomQuery::ISOLATION_REPEATED_READ = 3

◆ ISOLATION_SERIALIZABLE

const ilAtomQuery::ISOLATION_SERIALIZABLE = 4

◆ LOCK_READ

const ilAtomQuery::LOCK_READ = 2

Definition at line 16 of file interface.ilAtomQuery.php.

Referenced by ilTableLock\check().

◆ LOCK_WRITE


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