PHP Class MatthiasMullie\Scrapbook\Psr6\Item

Author: Matthias Mullie ([email protected])
Inheritance: implements Psr\Cache\CacheItemInterface
Show file Open project: matthiasmullie/scrapbook

Protected Properties

Property Type Description
$changed boolean
$expire integer
$hash string
$isHit boolean
$key string
$repository Repository
$value mixed

Public Methods

Method Description
__construct ( string $key, Repository $repository )
__destruct ( ) When this item is being killed, we should no longer keep its value around in the repository. Free up some memory!
expiresAfter ( $time )
expiresAt ( $expiration )
get ( )
getExpiration ( ) : integer Returns the set expiration time in integer form (as it's what KeyValueStore expects).
getKey ( )
hasChanged ( ) : boolean We'll want to know if this Item was altered (value or expiration date) once we'll want to store it.
isExpired ( ) : boolean Returns true if the item is already expired, false otherwise.
isHit ( )
overrideIsHit ( boolean $isHit ) Allow isHit to be override, in case it's a value that is returned from memory, when a value is being saved deferred.
set ( $value )

Method Details

__construct() public method

public __construct ( string $key, Repository $repository )
$key string
$repository Repository

__destruct() public method

When this item is being killed, we should no longer keep its value around in the repository. Free up some memory!
public __destruct ( )

expiresAfter() public method

public expiresAfter ( $time )

expiresAt() public method

public expiresAt ( $expiration )

get() public method

public get ( )

getExpiration() public method

Returns the set expiration time in integer form (as it's what KeyValueStore expects).
public getExpiration ( ) : integer
return integer

getKey() public method

public getKey ( )

hasChanged() public method

We'll want to know if this Item was altered (value or expiration date) once we'll want to store it.
public hasChanged ( ) : boolean
return boolean

isExpired() public method

Returns true if the item is already expired, false otherwise.
public isExpired ( ) : boolean
return boolean

isHit() public method

public isHit ( )

overrideIsHit() public method

Allow isHit to be override, in case it's a value that is returned from memory, when a value is being saved deferred.
public overrideIsHit ( boolean $isHit )
$isHit boolean

set() public method

public set ( $value )

Property Details

$changed protected property

protected bool $changed
return boolean

$expire protected property

protected int $expire
return integer

$hash protected property

protected string $hash
return string

$isHit protected property

protected bool $isHit
return boolean

$key protected property

protected string $key
return string

$repository protected property

protected Repository,MatthiasMullie\Scrapbook\Psr6 $repository
return Repository

$value protected property

protected mixed $value
return mixed