MediaWiki  master
Wikimedia\Rdbms\Database\DatabaseFlags Class Reference
Inheritance diagram for Wikimedia\Rdbms\Database\DatabaseFlags:
Collaboration diagram for Wikimedia\Rdbms\Database\DatabaseFlags:

Public Member Functions

 __construct ( $flags)
 
 clearFlag ( $flag, $remember=self::REMEMBER_NOTHING)
 Clear a flag for this connection. More...
 
 getFlag ( $flag)
 Returns a boolean whether the flag $flag is set for this connection. More...
 
 hasImplicitTrxFlag ()
 
 restoreFlags ( $state=self::RESTORE_PRIOR)
 Restore the flags to their prior state before the last setFlag/clearFlag call. More...
 
 setFlag ( $flag, $remember=self::REMEMBER_NOTHING)
 Set a flag for this connection. More...
 

Static Public Member Functions

static contains (int $flags, int $bit)
 

Protected Attributes

int $flags
 Current bit field of class DBO_* constants. More...
 

Detailed Description

Access: internal
Since
1.39

Definition at line 29 of file DatabaseFlags.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\Database\DatabaseFlags::__construct (   $flags)

Definition at line 47 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

Member Function Documentation

◆ clearFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::clearFlag (   $flag,
  $remember = self::REMEMBER_NOTHING 
)

Clear a flag for this connection.

Parameters
int$flagOne of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
string$rememberIDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 65 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

◆ contains()

static Wikimedia\Rdbms\Database\DatabaseFlags::contains ( int  $flags,
int  $bit 
)
static
Parameters
int$flagsA bitfield of flags
int$bitBit flag constant
Returns
bool Whether the bit field has the specified bit flag set
Since
1.34

Definition at line 102 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

◆ getFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::getFlag (   $flag)

Returns a boolean whether the flag $flag is set for this connection.

Parameters
int$flagOne of the class IDatabase::DBO_* constants
Returns
bool

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 92 of file DatabaseFlags.php.

Referenced by Wikimedia\Rdbms\Database\DatabaseFlags\hasImplicitTrxFlag().

◆ hasImplicitTrxFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::hasImplicitTrxFlag ( )

Definition at line 106 of file DatabaseFlags.php.

References DBO_TRX, and Wikimedia\Rdbms\Database\DatabaseFlags\getFlag().

◆ restoreFlags()

Wikimedia\Rdbms\Database\DatabaseFlags::restoreFlags (   $state = self::RESTORE_PRIOR)

Restore the flags to their prior state before the last setFlag/clearFlag call.

Parameters
string$stateIDatabase::RESTORE_* constant. [default: RESTORE_PRIOR]
Since
1.28

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 79 of file DatabaseFlags.php.

◆ setFlag()

Wikimedia\Rdbms\Database\DatabaseFlags::setFlag (   $flag,
  $remember = self::REMEMBER_NOTHING 
)

Set a flag for this connection.

Parameters
int$flagOne of (IDatabase::DBO_DEBUG, IDatabase::DBO_TRX)
string$rememberIDatabase::REMEMBER_* constant [default: REMEMBER_NOTHING]

Implements Wikimedia\Rdbms\Database\IDatabaseFlags.

Definition at line 51 of file DatabaseFlags.php.

References Wikimedia\Rdbms\Database\DatabaseFlags\$flags.

Member Data Documentation

◆ $flags

int Wikimedia\Rdbms\Database\DatabaseFlags::$flags
protected

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