# Google Auth Library Client - Class MemoryCacheItemPool (1.50.1)

1.50.1 (latest) 1.50.0 1.49.0 1.48.1 1.47.1 1.46.0 1.45.2 Reference documentation and code samples for the Google Auth Library Client class MemoryCacheItemPool.

Simple in-memory cache implementation.

## Namespace

Google \\ Auth \\ Cache

## Methods

### getItem

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `mixed` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Psr\Cache\CacheItemInterface` | The corresponding Cache Item. |

### getItems

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `keys` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `iterable<\psr\cache\cacheiteminterface>` | A traversable collection of Cache Items keyed by the cache keys of each item. A Cache item will be returned for each key, even if that key is not found. However, if no keys are specified then an empty traversable MUST be returned instead. |

### hasItem

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `mixed` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if item exists in the cache, false otherwise. |

### clear

{@inheritdoc}

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if the pool was successfully cleared. False if there was an error. |

### deleteItem

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `mixed` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if the item was successfully removed. False if there was an error. |

### deleteItems

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `keys` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if the items were successfully removed. False if there was an error. |

### save

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `item` | `Psr\Cache\CacheItemInterface` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if the item was successfully persisted. False if there was an error. |

### saveDeferred

{@inheritdoc}

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `item` | `Psr\Cache\CacheItemInterface` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | False if the item could not be queued or if a commit was attempted and failed. True otherwise. |

### commit

{@inheritdoc}

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` | True if all not-yet-saved items were successfully saved or there were none. False otherwise. |