Added pre and post processing event disatching

This commit is contained in:
Franck Allimant
2014-06-26 19:52:28 +02:00
parent ca862b07e4
commit 2c9accf58e
3 changed files with 53 additions and 77 deletions

View File

@@ -12,6 +12,7 @@
namespace Thelia\Core\Event\Image;
use Imagine\Image\ImageInterface;
use Thelia\Core\Event\CachedFileEvent;
class ImageEvent extends CachedFileEvent
@@ -71,6 +72,11 @@ class ImageEvent extends CachedFileEvent
*/
protected $quality = null;
/**
* @var ImageInterface
*/
protected $imageObject;
/**
* @return boolean true if the required image is the original image (resize_mode and background_color are not significant)
*/
@@ -209,4 +215,21 @@ class ImageEvent extends CachedFileEvent
return $this;
}
/**
* @param ImageInterface $imageObject
* @return $this
*/
public function setImageObject($imageObject)
{
$this->imageObject = $imageObject;
return $this;
}
/**
* @return ImageInterface
*/
public function getImageObject() {
return $this->imageObject;
}
}

View File

@@ -382,6 +382,16 @@ final class TheliaEvents
*/
const IMAGE_PROCESS = "action.processImage";
/**
* Sent just after creating the image object from the image file
*/
const IMAGE_PREPROCESSING = "action.preProcessImage";
/**
* Sent just before saving the processed image object on disk
*/
const IMAGE_POSTPROCESSING = "action.postProcessImage";
/**
* Sent on document processing
*/