file-fetcher
All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
Contracts\Mock\Storage\Memory Class Reference
Inheritance diagram for Contracts\Mock\Storage\Memory:
Contracts\RetrieverInterface Contracts\StorerInterface Contracts\BulkRetrieverInterface Contracts\Mock\Storage\JsonObjectMemory

Public Member Functions

 retrieve (string $id)
 
 retrieveAll ()
 
 store ($data, string $id=null)
 
 remove (string $id)
 

Protected Attributes

 $storage = []
 

Member Function Documentation

◆ remove()

Contracts\Mock\Storage\Memory::remove ( string  $id)

◆ retrieve()

Contracts\Mock\Storage\Memory::retrieve ( string  $id)

Retrieve.

Parameters
string$idThe identifier for the data.
Returns
string | HydratableInterface The data or null if no data could be retrieved.

Implements Contracts\RetrieverInterface.

◆ retrieveAll()

Contracts\Mock\Storage\Memory::retrieveAll ( )

Retrieve all.

Returns
array An array of ids.

Implements Contracts\BulkRetrieverInterface.

Reimplemented in Contracts\Mock\Storage\JsonObjectMemory.

◆ store()

Contracts\Mock\Storage\Memory::store (   $data,
string  $id = null 
)

Store.

Parameters
string | HydratableInterface$dataThe data to be stored.
string$idThe identifier for the data. If the act of storing generates the id, there is no need to pass one.
Returns
string The identifier.
Exceptions

Implements Contracts\StorerInterface.

Reimplemented in Contracts\Mock\Storage\JsonObjectMemory.

Member Data Documentation

◆ $storage

Contracts\Mock\Storage\Memory::$storage = []
protected

The documentation for this class was generated from the following file: