File tree 5 files changed +20
-16
lines changed
MediaContentSynchronization
MediaGallerySynchronization/Model
5 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 8
8
namespace Magento \MediaContentSynchronization \Model ;
9
9
10
10
use Magento \Framework \Exception \LocalizedException ;
11
+ use Magento \MediaContentApi \Api \Data \ContentIdentityInterface ;
11
12
use Magento \MediaContentSynchronizationApi \Api \SynchronizeIdentitiesInterface ;
12
13
use Magento \MediaContentSynchronizationApi \Api \SynchronizeInterface ;
13
14
@@ -40,15 +41,15 @@ public function __construct(
40
41
41
42
/**
42
43
* Run media files synchronization.
43
- * @param string[] $message
44
+ * @param string[] $identities
44
45
* @throws LocalizedException
45
46
*/
46
- public function execute (array $ message ) : void
47
+ public function execute (array $ identities ) : void
47
48
{
48
- $ this -> synchronize -> execute ();
49
-
50
- if (! empty ( $ message )) {
51
- $ this ->synchronizeIdentities ->execute ($ message );
49
+ if (! empty ( $ identities )) {
50
+ $ this -> synchronizeIdentities -> execute ( $ identities );
51
+ } else {
52
+ $ this ->synchronize ->execute ();
52
53
}
53
54
}
54
55
}
Original file line number Diff line number Diff line change @@ -34,12 +34,13 @@ public function __construct(PublisherInterface $publisher)
34
34
35
35
/**
36
36
* Publish media content synchronization message to the message queue.
37
+ * @param array $contentIdentities
37
38
*/
38
- public function execute () : void
39
+ public function execute (array $ contentIdentities = [] ) : void
39
40
{
40
41
$ this ->publisher ->publish (
41
42
self ::TOPIC_MEDIA_CONTENT_SYNCHRONIZATION ,
42
- [ self :: TOPIC_MEDIA_CONTENT_SYNCHRONIZATION ]
43
+ $ contentIdentities
43
44
);
44
45
}
45
46
}
Original file line number Diff line number Diff line change 7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
9
9
<preference for =" Magento\MediaContentSynchronizationApi\Api\SynchronizeInterface" type =" Magento\MediaContentSynchronization\Model\Synchronize" />
10
+ <preference for =" Magento\MediaContentSynchronizationApi\Api\SynchronizeIdentitiesInterface" type =" Magento\MediaContentSynchronization\Model\SynchronizeIdentities" />
10
11
<type name =" Magento\Framework\Console\CommandListInterface" >
11
12
<arguments >
12
13
<argument name =" commands" xsi : type =" array" >
Original file line number Diff line number Diff line change @@ -40,15 +40,15 @@ public function __construct(
40
40
41
41
/**
42
42
* Run media files synchronization.
43
- * @param string[] $message
43
+ * @param array $paths
44
44
* @throws LocalizedException
45
45
*/
46
- public function execute (array $ message ) : void
46
+ public function execute (array $ paths ) : void
47
47
{
48
- $ this -> synchronize -> execute ();
49
-
50
- if (! empty ( $ message )) {
51
- $ this ->synchronizeFiles ->execute ($ message );
48
+ if (! empty ( $ paths )) {
49
+ $ this -> synchronizeFiles -> execute ( $ paths );
50
+ } else {
51
+ $ this ->synchronize ->execute ();
52
52
}
53
53
}
54
54
}
Original file line number Diff line number Diff line change @@ -34,12 +34,13 @@ public function __construct(PublisherInterface $publisher)
34
34
35
35
/**
36
36
* Publish media content synchronization message to the message queue.
37
+ * @param array $paths
37
38
*/
38
- public function execute () : void
39
+ public function execute (array $ paths = [] ) : void
39
40
{
40
41
$ this ->publisher ->publish (
41
42
self ::TOPIC_MEDIA_GALLERY_SYNCHRONIZATION ,
42
- [ self :: TOPIC_MEDIA_GALLERY_SYNCHRONIZATION ]
43
+ $ paths
43
44
);
44
45
}
45
46
}
You can’t perform that action at this time.
0 commit comments