mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
init memory model
This commit is contained in:
parent
d40d95528d
commit
95abe81547
1 changed files with 17 additions and 0 deletions
|
|
@ -6,6 +6,23 @@ namespace Yggverse\Yoda\Model;
|
||||||
|
|
||||||
class Memory
|
class Memory
|
||||||
{
|
{
|
||||||
|
private array $_memory = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
public function set(string $key, mixed $value): void
|
||||||
|
{
|
||||||
|
$this->_memory[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get(string $key): mixed
|
||||||
|
{
|
||||||
|
if (isset($this->_memory[$key]))
|
||||||
|
{
|
||||||
|
return $this->_memory[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue