<?php
namespace Jabber\GenericBundle\EventListener;
use Jabber\GenericBundle\Cache\LocalCache;
use Pimcore\Event\Model\DataObjectEvent;
use Pimcore\Model\DataObject\Product;
use Pimcore\Event\Model\ElementEventInterface;
class ImageMetadata {
public function onPostUpdate (ElementEventInterface $e) {
if (!$e->hasArgument('isAutoSave')) {
if ($e instanceof DataObjectEvent) {
// do something with the object
$dataObject = $e->getObject();
if ($dataObject instanceof Product) {
if ($dataObject->getType() == "variant" && $dataObject->getProductLevel() == "STYLE") {
if (method_exists($dataObject, "getImages")) {
$redis = new \Redis();
$redis->connect('127.0.0.1', 6379);
$redis->set("jabber_genericbundle_imagemetadata_dev_".$dataObject->getId(), $dataObject->getId());
}
}
}
}
}
}
}