Skip to content

Commit

Permalink
ACP-3963 Algolia Event-Based Features. (#11158)
Browse files Browse the repository at this point in the history
ACP-3963 Algolia Event-Based Features.
  • Loading branch information
vol4onok authored Nov 21, 2024
1 parent d07fc5d commit 44cc5c9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@ public function generateKey(SynchronizationDataTransfer $dataTransfer)
{
$reference = $dataTransfer->getReference() ? $this->keyFilter->escapeKey($dataTransfer->getReference()) : null;
$localeAndStore = $this->getStoreAndLocaleKey($dataTransfer);
/** @var string $keySuffix */
$keySuffix = $reference && $localeAndStore
? sprintf('%s:%s', $localeAndStore, $reference)
: sprintf('%s%s', $localeAndStore, $reference);

return sprintf('%s:%s', $this->getResource(), $keySuffix);
return sprintf(
'%s%s%s',
$this->getResource(),
$keySuffix ? ':' : '',
$keySuffix,
);
}
}

0 comments on commit 44cc5c9

Please sign in to comment.