phpolar/storage

A convenient tool to speed up the creation of data storage for application development.

2.0.0 2023-09-02 23:34 UTC

This package is auto-updated.

Last update: 2024-10-28 02:27:35 UTC


README

PHPolar Data Storage Abstraction

Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Use to create persistence layer repositories, services, etc. with improved type safety.

Usage

class KafkaStorage extends AbstractStorage
{
    public function __construct(
        // ...
    ) {
        parent::__construct();
        // ...
    }
    // ...
}


$key0 = new ItemKey(uniqid());

$kafkaStorage->storeByKey($key0, $data);

$item0 = $kafkaStorage->getByKey($key0);

$numItems = $kafkaStorage->count();

$allItems = $kafkaStorage->getAll();

$kafka->removeByKey($key0);

$kafka->clear();