34 private $priorFlags = [];
37 protected const MUTABLE_FLAGS = [
44 protected const DBO_MUTABLE = (
52 public function setFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
53 if ( $flag & ~static::DBO_MUTABLE ) {
55 "Got $flag (allowed: " . implode(
', ', static::MUTABLE_FLAGS ) .
')'
59 if ( $remember === self::REMEMBER_PRIOR ) {
63 $this->flags |= $flag;
66 public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
67 if ( $flag & ~static::DBO_MUTABLE ) {
69 "Got $flag (allowed: " . implode(
', ', static::MUTABLE_FLAGS ) .
')'
73 if ( $remember === self::REMEMBER_PRIOR ) {
77 $this->flags &= ~$flag;
81 if ( !$this->priorFlags ) {
85 if ( $state === self::RESTORE_INITIAL ) {
86 $this->flags = reset( $this->priorFlags );
87 $this->priorFlags = [];
89 $this->flags = array_pop( $this->priorFlags );
94 return ( ( $this->flags & $flag ) === $flag );
103 return ( (
$flags & $bit ) === $bit );
113 self::contains( $queryFlags, ISQLPlatform::QUERY_CHANGE_SCHEMA ) ||
114 self::contains( $queryFlags, ISQLPlatform::QUERY_CHANGE_LOCKS ) ||
123 return $this->
getFlag( self::DBO_TRX );