35 public static function hasFlags( $bitfield, $flags ) {
36 return ( $bitfield & $flags ) == $flags;
53 if ( self::hasFlags( $bitfield, self::READ_LATEST_IMMUTABLE ) ) {
56 } elseif ( self::hasFlags( $bitfield, self::READ_LATEST ) ) {
58 $fallbackIndex =
null;
61 $fallbackIndex =
null;
65 if ( self::hasFlags( $bitfield, self::READ_EXCLUSIVE ) ) {
66 $lockingOptions[] =
'FOR UPDATE';
67 } elseif ( self::hasFlags( $bitfield, self::READ_LOCKING ) ) {
68 $lockingOptions[] =
'LOCK IN SHARE MODE';
71 if ( $fallbackIndex !==
null ) {
73 $fallbackOptions = $lockingOptions;
75 $options = $lockingOptions;
76 $fallbackOptions = [];
79 return [ $index, $options, $fallbackIndex, $fallbackOptions ];