Cachearium\CacheData::setKey PHP Method

setKey() public method

public setKey ( CacheKey $ck ) : CacheData
$ck CacheKey
return CacheData
    public function setKey(CacheKey $ck)
    {
        $this->key = $ck;
        return $this;
    }

Usage Example

Example #1
0
 public function testKey()
 {
     $ck = new CacheKey('base', 'id', 'sub');
     $cd = new CacheData($ck, '');
     $this->assertEquals($cd->key, $ck);
     $ck2 = new CacheKey('base', 'id', 'sub2');
     $cd->setKey($ck2);
     $this->assertEquals($cd->key, $ck2);
 }