+ if ( self::hasFlags( $bitfield, self::READ_LATEST_IMMUTABLE ) ) {
+ $index = DB_REPLICA; // override READ_LATEST if set
+ $fallbackIndex = DB_MASTER;
+ } elseif ( self::hasFlags( $bitfield, self::READ_LATEST ) ) {
+ $index = DB_MASTER;
+ $fallbackIndex = null;
+ } else {
+ $index = DB_REPLICA;
+ $fallbackIndex = null;
+ }
+
+ $lockingOptions = [];
+ if ( self::hasFlags( $bitfield, self::READ_EXCLUSIVE ) ) {
+ $lockingOptions[] = 'FOR UPDATE';
+ } elseif ( self::hasFlags( $bitfield, self::READ_LOCKING ) ) {
+ $lockingOptions[] = 'LOCK IN SHARE MODE';
+ }