From b1cfd7f376e14e28794a54ecb7236ddfeb26aafb Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 22 Nov 2019 22:36:59 +0300 Subject: [PATCH] feat(core): add new public method delete() #308 --- flextype/core/Cache.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flextype/core/Cache.php b/flextype/core/Cache.php index 30205090..c5fb1fef 100755 --- a/flextype/core/Cache.php +++ b/flextype/core/Cache.php @@ -356,6 +356,18 @@ class Cache $this->driver->save($id, $data, $lifetime); } + /** + * Delete item from the chache + */ + public function delete(string $id) : void + { + if (! $this->flextype['registry']->get('settings.cache.enabled')) { + return; + } + + $this->driver->delete($id); + } + /** * Clear Cache */