20 private $priorFlags = [];
23 protected const MUTABLE_FLAGS = [
30 protected const DBO_MUTABLE = (
39 public function setFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
40 if ( $flag & ~static::DBO_MUTABLE ) {
42 "Got $flag (allowed: " . implode(
', ', static::MUTABLE_FLAGS ) .
')'
46 if ( $remember === self::REMEMBER_PRIOR ) {
50 $this->flags |= $flag;
54 public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
55 if ( $flag & ~static::DBO_MUTABLE ) {
57 "Got $flag (allowed: " . implode(
', ', static::MUTABLE_FLAGS ) .
')'
61 if ( $remember === self::REMEMBER_PRIOR ) {
65 $this->flags &= ~$flag;
70 if ( !$this->priorFlags ) {
74 if ( $state === self::RESTORE_INITIAL ) {
75 $this->flags = reset( $this->priorFlags );
76 $this->priorFlags = [];
78 $this->flags = array_pop( $this->priorFlags );
84 return ( ( $this->flags & $flag ) === $flag );
93 return ( (
$flags & $bit ) === $bit );
103 self::contains( $queryFlags, ISQLPlatform::QUERY_CHANGE_SCHEMA ) ||
104 self::contains( $queryFlags, ISQLPlatform::QUERY_CHANGE_LOCKS ) ||
113 return $this->
getFlag( self::DBO_TRX );