phpolar/storage

一个方便的工具,用于加速应用程序开发中的数据存储创建。

2.0.0 2023-09-02 23:34 UTC

This package is auto-updated.

Last update: 2024-08-28 02:08:25 UTC


README

PHPolar 数据存储抽象

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

用于创建具有改进类型安全的持久层存储库、服务等。

使用方法

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();