Webiny\Component\Storage\Storage::keyExists PHP Method

keyExists() public method

Indicates whether the key exists
public keyExists ( string $key ) : boolean
$key string
return boolean
    public function keyExists($key)
    {
        return $this->driver->keyExists($key);
    }

Usage Example

Example #1
0
 /**
  * @dataProvider driverSet
  */
 public function testStorage(Storage $storage)
 {
     $storage->setContents($this->key, 'Test contents');
     $this->assertTrue($storage->keyExists($this->key));
     $this->assertSame('Test contents', $storage->getContents($this->key));
     $storage->deleteKey($this->key);
     $this->assertFalse($storage->keyExists($this->key));
 }
All Usage Examples Of Webiny\Component\Storage\Storage::keyExists