init
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\Wiki\Model\Config\Backend;
|
||||
|
||||
use Magento\Config\Model\Config\Backend\Image;
|
||||
|
||||
class BannerImage extends Image
|
||||
{
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
protected function _getAllowedExtensions()
|
||||
{
|
||||
return ['jpg', 'jpeg', 'gif', 'png', 'webp'];
|
||||
}
|
||||
|
||||
public function afterSave()
|
||||
{
|
||||
$result = parent::afterSave();
|
||||
$this->cleanPageCaches();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function afterDelete()
|
||||
{
|
||||
$result = parent::afterDelete();
|
||||
$this->cleanPageCaches();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function cleanPageCaches(): void
|
||||
{
|
||||
$this->cacheTypeList->cleanType('block_html');
|
||||
$this->cacheTypeList->cleanType('full_page');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user