<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
blackbird / magento-2-clean-product-image-cache example snippets
class MyCleanCacheStrategy implements CleanCacheStrategyInterface
{
/**
* {@inheritDoc}
*/
public function clean(ProductInterface $product): void
{
//Do what you need to do
}
}
class AfterCleanMagentoImageCache implements ObserverInterface
{
/**
* {@inheritDoc}
*/
public function execute(Observer $observer): void
{
//Get absolute path off all cached images for the cleaned product
$paths = $observer->getPaths();
//Do what you need to do
}
}