-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageProcessed.php
39 lines (31 loc) · 1.11 KB
/
ImageProcessed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace LaSalle\Rendimiento\JudithVilela\ImageRegister\Application\ImageProcessed;
use LaSalle\Rendimiento\JudithVilela\ImageRegister\Domain\Model\Aggregate\ImageRegister;
use LaSalle\Rendimiento\JudithVilela\ImageRegister\Domain\Service\ImageProcess;
final class ImageProcessed
{
/** @var ImageProcess */
private $imageProcess;
public function __construct(ImageProcess $imageProcess)
{
$this->imageProcess = $imageProcess;
}
/**
* @param ImageProcessedRequest
*/
public function __invoke(ImageProcessedRequest $imageProcessedRequest)
{
$imageToProcess = new ImageRegister(
null,
$imageProcessedRequest->nameImage(),
$imageProcessedRequest->pathImage(),
$imageProcessedRequest->extImage(),
null,
$imageProcessedRequest->tagImage(),
$imageProcessedRequest->descriptionImage(),
$imageProcessedRequest->newPathImage()
);
$message = $imageToProcess->message();
$this->imageProcess->send($message);
}
}