Добрый день! Добавил в событие (в CacheClearHandler.php) таким образом и получили ошибку в строке 81: \Indikator\News...
Можете смотреть в чем дело?
<?php namespace BizMark\Quicksilver\Classes\Event;
use Cms\Classes\Page;
use System\Classes\PluginManager;
use BizMark\Quicksilver\Models\Settings;
use BizMark\Quicksilver\Classes\CacheCleaner;
class CacheClearHandler
{
public function subscribe($event)
{
$event->listen('cache:cleared', static function (): void {
CacheCleaner::clear();
});
if (Settings::isAutoclearingEnabled() === true) {
$pluginManager = PluginManager::instance();
$this->cmsPagesClearing();
if ($pluginManager->hasPlugin('RainLab.Blog')) {
$this->rainlabStaticPagesClearing();
}
if ($pluginManager->hasPlugin('RainLab.Pages')) {
$this->rainlabBlogClearing();
}
if ($pluginManager->hasPlugin('Indikator.News')) {
$this->indikatorNewsClearing();
}
if ($pluginManager->hasPlugin('JanVinceSmall.Records')) {
$this->janVinceSmallRecordsClearing();
}
}
}
public function cmsPagesClearing()
{
Page::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::clearUrl($model->url);
});
});
}
public function rainlabStaticPagesClearing()
{
\RainLab\Pages\Classes\Page::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::clearUrl($model->url);
});
});
\RainLab\Pages\Classes\Menu::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::clear();
});
});
}
public function rainlabBlogClearing()
{
\RainLab\Blog\Models\Post::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::scheduleOrClearPost($model);
});
});
\RainLab\Blog\Models\Category::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::clearCategory($model);
});
});
}
public function indikatorNewsClearing()
{
\Indikator\News\Models\Posts::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::scheduleOrClearItem($model);
});
});
\Indikator\News\Models\Categories::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::clearCategory($model);
});
});
}
public function janVinceSmallRecordsClearing()
{
\JanVince\SmallRecords\Models\Record::extend(function ($model) {
$model->bindEvent('model.afterSave', function () use ($model) {
CacheCleaner::scheduleOrClearRecord($model);
});
});
}
}