Jyxo\Spl\ObjectCache::clear PHP Метод

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

Clear the whole storage.
public clear ( ) : self
Результат self
    public function clear() : self
    {
        $this->storage = [];
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Tests unset().
  */
 public function testUnset()
 {
     // Nothing is saved
     $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
     // Save and check
     $this->saveObject();
     $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
     // Unset the object and check
     unset($this->cache->{self::CACHE_KEY});
     $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
     // Save and check again
     $this->saveObject();
     $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
     $this->cache->clear();
 }