Neos\Cache\Backend\RedisBackend::has PHP Метод

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

Checks if a cache entry with the specified identifier exists.
public has ( string $entryIdentifier ) : boolean
$entryIdentifier string An identifier specifying the cache entry
Результат boolean TRUE if such an entry exists, FALSE if not
    public function has($entryIdentifier)
    {
        return $this->redis->exists($this->buildKey('entry:' . $entryIdentifier));
    }

Usage Example

 /**
  * @test
  */
 public function expiredEntriesAreSkippedWhenIterating()
 {
     $this->backend->set('entry1', 'foo', [], 1);
     sleep(2);
     $this->assertFalse($this->backend->has('entry1'));
     $actualEntries = [];
     foreach ($this->backend as $key => $value) {
         $actualEntries[] = $key;
     }
     $this->assertEmpty($actualEntries, 'Entries should be empty');
 }
All Usage Examples Of Neos\Cache\Backend\RedisBackend::has