1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace Shopware\Core\Content\Media\Message; |
4
|
|
|
|
5
|
|
|
use Shopware\Core\Framework\Context; |
6
|
|
|
use Shopware\Core\Framework\Feature; |
7
|
|
|
use Shopware\Core\Framework\Log\Package; |
8
|
|
|
use Shopware\Core\Framework\MessageQueue\AsyncMessageInterface; |
9
|
|
|
|
10
|
|
|
#[Package('content')] |
11
|
|
|
class GenerateThumbnailsMessage implements AsyncMessageInterface |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var array<string> |
15
|
|
|
*/ |
16
|
|
|
private array $mediaIds = []; |
17
|
|
|
|
18
|
|
|
private Context $context; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @deprecated tag:v6.6.0 - Property will be removed, use context instead |
22
|
|
|
*/ |
23
|
|
|
private string $contextData; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @return array<string> |
27
|
|
|
*/ |
28
|
|
|
public function getMediaIds(): array |
29
|
|
|
{ |
30
|
|
|
return $this->mediaIds; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param array<string> $mediaIds |
35
|
|
|
*/ |
36
|
|
|
public function setMediaIds(array $mediaIds): void |
37
|
|
|
{ |
38
|
|
|
$this->mediaIds = $mediaIds; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function getContextData(): string |
42
|
|
|
{ |
43
|
|
|
return $this->contextData; |
|
|
|
|
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function setContextData(string $contextData): void |
47
|
|
|
{ |
48
|
|
|
$this->contextData = $contextData; |
|
|
|
|
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @deprecated tag:v6.6.0 - Will be removed |
53
|
|
|
*/ |
54
|
|
|
public function withContext(Context $context): GenerateThumbnailsMessage |
55
|
|
|
{ |
56
|
|
|
Feature::triggerDeprecationOrThrow( |
57
|
|
|
'v6.6.0.0', |
58
|
|
|
Feature::deprecatedMethodMessage(self::class, __METHOD__, 'v6.6.0.0') |
59
|
|
|
); |
60
|
|
|
$this->contextData = serialize($context); |
|
|
|
|
61
|
|
|
|
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @deprecated tag:v6.6.0 - Will be removed |
67
|
|
|
*/ |
68
|
|
|
public function readContext(): Context |
69
|
|
|
{ |
70
|
|
|
Feature::triggerDeprecationOrThrow( |
71
|
|
|
'v6.6.0.0', |
72
|
|
|
Feature::deprecatedMethodMessage(self::class, __METHOD__, 'v6.6.0.0') |
73
|
|
|
); |
74
|
|
|
|
75
|
|
|
return unserialize($this->contextData); |
|
|
|
|
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function getContext(): Context |
79
|
|
|
{ |
80
|
|
|
return $this->context; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function setContext(Context $context): void |
84
|
|
|
{ |
85
|
|
|
$this->context = $context; |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.