}
$audience = $this->checkAudience( $audience );
- $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_SLAVE );
- $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
- ? [ 'LOCK IN SHARE MODE' ]
- : [];
+ list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags );
+ $db = wfGetDB( $index );
$tables = [ 'user' ];
$fields = [ 'user_id', 'user_name' ];
}
$audience = $this->checkAudience( $audience );
- $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_SLAVE );
- $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
- ? [ 'LOCK IN SHARE MODE' ]
- : [];
+ list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags );
+ $db = wfGetDB( $index );
$tables = [ 'user' ];
$fields = [ 'user_id', 'user_name' ];