flextype-components / registry
Registry component provides a mechanism for storing data globally in a well managed fashion, helping to prevent global meltdown.
Installs: 5 310
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1.3
- flextype-components/arrays: *
Requires (Dev)
- doctrine/coding-standard: 7.0.2
README
Registry component provides a mechanism for storing data globally in a well managed fashion, helping to prevent global meltdown.
Installation
With Composer:
composer require flextype-components/registry
Usage
use Flextype\Component\Registry; $registry = new Registry();
Methods
Method: set()
Set a value in the registry.
Example:
$registry->set('movies.the-thin-red-line.title', 'The Thin Red Line');
Method: get()
Get item from the registry.
Example:
$registry->get('movies.the-thin-red-line.title');
Method: has()
Determine if the registry has a value for the given name.
Example:
if ($registry->has('movies.the-thin-red-line.title')) { // do something... }
Method: delete()
Example:
$registry->delete('movies.the-thin-red-line.title');
Method: flush()
Flush all values from the registry.
Example:
$registry->flush();
Method: all()
Get all values in the register.
Example:
$dump = $registry->all();
License
The MIT License (MIT) Copyright (c) 2020 Sergey Romanenko