ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAtomQuery Interface Reference

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

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

Public Member Functions

 addTableLock (string $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 (int $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 27 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());

Exceptions
ilAtomQueryException

◆ addTableLock()

ilAtomQuery::addTableLock ( string  $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

◆ checkCallable()

ilAtomQuery::checkCallable ( callable  $query)

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

◆ checkIsolationLevel()

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

◆ getIsolationLevel()

ilAtomQuery::getIsolationLevel ( )

Returns the current Isolation-Level.

◆ 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());

Exceptions
ilAtomQueryException

◆ run()

ilAtomQuery::run ( )

Fire your Queries.

Exceptions

Implemented in ilAtomQueryLock, and ilAtomQueryTransaction.

Field Documentation

◆ ANO_DIRTY_READ

const ilAtomQuery::ANO_DIRTY_READ = 2

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

◆ ANO_LOST_UPDATES

const ilAtomQuery::ANO_LOST_UPDATES = 1

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

◆ ANO_NON_REPEATED_READ

const ilAtomQuery::ANO_NON_REPEATED_READ = 3

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

◆ ANO_PHANTOM

const ilAtomQuery::ANO_PHANTOM = 4

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

◆ ISOLATION_READ_COMMITED

const ilAtomQuery::ISOLATION_READ_COMMITED = 2

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

◆ ISOLATION_READ_UNCOMMITED

const ilAtomQuery::ISOLATION_READ_UNCOMMITED = 1

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

Referenced by ilAtomQueryBase\checkIsolationLevel().

◆ ISOLATION_REPEATED_READ

const ilAtomQuery::ISOLATION_REPEATED_READ = 3

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

◆ ISOLATION_SERIALIZABLE

const ilAtomQuery::ISOLATION_SERIALIZABLE = 4

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

◆ LOCK_READ

const ilAtomQuery::LOCK_READ = 2

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

Referenced by ilTableLock\check().

◆ LOCK_WRITE

const ilAtomQuery::LOCK_WRITE = 1

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