Skip to content

phpolar/storage

Repository files navigation

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($lifeCycleHooks);
        // ...
    }
    // ...
}


$key0 = uniqid();

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

$result = $kafkaStorage->find($key0);

$item0 = $result
    ->orElse(static function () {
            $this->logger->warn($notFoundMessage);
            return new ResourceNotFound();
        }
    )
    ->tryUnwrap()

$numItems = $kafkaStorage->count();

$allItems = $kafkaStorage->findAll();

$kafka->remove($key0);

$kafka->clear();

About

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

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages