You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
523 B
26 lines
523 B
<?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();
|
|
}
|
|
}
|