Cache\Adapter\Common\CacheItem::set PHP Method

set() public method

public set ( $value )
    public function set($value)
    {
        $this->value = $value;
        $this->hasValue = true;
        $this->callable = null;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testHit()
 {
     $item = new CacheItem('test_key');
     $this->assertFalse($item->isHit());
     $item->set('foobar');
     $this->assertTrue($item->isHit());
     $item->set(null);
     $this->assertTrue($item->isHit());
     $item->expiresAfter(5);
     $this->assertTrue($item->isHit());
     $item->expiresAfter(-1);
     $this->assertFalse($item->isHit());
 }
All Usage Examples Of Cache\Adapter\Common\CacheItem::set