Menu

## CacheItem
in package
implements CacheItemInterface

CacheItem.php : 20

This class represents a cache item that implements the PSR-16 CacheItemInterface.

##### Tags

see
  https://www.kotchasan.com/

### Interfaces, Classes and Traits

CacheItemInterface
  CacheItemInterface defines an interface for interacting with objects inside a cache.

### Table of Contents

$hit : bool
$key : string
  Cache Key
$value : mixed
  Cache value
__construct() : mixed
  Class constructor
expiresAfter() : static
  Set the expiration time of the cache item (in seconds)
expiresAt() : static
  Set the expiration date and time of the cache item
get() : mixed
  Get the value of the cache item
getKey() : string
  Get the key of the cache item
isHit() : bool
  Check if the cache item has a value
set() : static
  Set the value of the cache item

### Properties

#### $hit

CacheItem.php : 25
`private bool $hit`

#### $key

CacheItem.php : 31

Cache Key

`private string $key`

#### $value

CacheItem.php : 37

Cache value

`private mixed $value`

### Methods

#### __construct()

CacheItem.php : 44

Class constructor

`public __construct(string $key) : mixed`

##### Parameters

$key : string

  Cache Key

##### Return values

mixed —

#### expiresAfter()

CacheItem.php : 58

Set the expiration time of the cache item (in seconds)

`public expiresAfter(int|DateInterval $time) : static`

##### Parameters

$time : int|DateInterval

##### Return values

static —

#### expiresAt()

CacheItem.php : 70

Set the expiration date and time of the cache item

`public expiresAt(DateTimeInterface $expiration) : static`

##### Parameters

$expiration : DateTimeInterface

##### Return values

static —

#### get()

CacheItem.php : 80

Get the value of the cache item

`public get() : mixed`

##### Return values

mixed —

#### getKey()

CacheItem.php : 90

Get the key of the cache item

`public getKey() : string`

##### Return values

string —

#### isHit()

CacheItem.php : 100

Check if the cache item has a value

`public isHit() : bool`

##### Return values

bool —

#### set()

CacheItem.php : 112

Set the value of the cache item

`public set(mixed $value) : static`

##### Parameters

$value : mixed

##### Return values

static —

## Search results