Initial commit.

This commit is contained in:
2022-11-10 10:49:09 +03:00
commit 3a439538ca
7 changed files with 240 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php namespace Wpstudio\Helpers\Classes\Observer;
abstract class BaseObserver implements Observer
{
protected static string $class;
/**
* Очистка кэша
* @return void
*/
public static function clearCache(): void
{
$tags = [self::getCacheTag()];
\Cache::tags($tags)->flush();
}
/**
* Получение тэка кеша
* @return string
*/
public static function getCacheTag(): string
{
return static::getClass();
}
}

View File

@ -0,0 +1,6 @@
<?php namespace Wpstudio\Helpers\Classes\Observer;
interface Observer
{
public static function getClass(): string;
}