Predis\Transaction\MultiExecState::isWatchAllowed PHP Метод

isWatchAllowed() публичный Метод

Returns if WATCH is allowed in the current state.
public isWatchAllowed ( ) : boolean
Результат boolean
    public function isWatchAllowed()
    {
        return $this->check(self::INITIALIZED) && !$this->check(self::CAS);
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testIsWatchAllowed()
 {
     $state = new MultiExecState();
     $this->assertFalse($state->isWatchAllowed());
     $state->flag(MultiExecState::INITIALIZED);
     $this->assertTrue($state->isWatchAllowed());
     $state->flag(MultiExecState::CAS);
     $this->assertFalse($state->isWatchAllowed());
     $state->unflag(MultiExecState::CAS);
     $this->assertTrue($state->isWatchAllowed());
 }