ratingsAndReviewsFeedApi = $ratingsAndReviewsFeedApi;
$this->systemConfig = $systemConfig;
$this->fbeHelper = $fbeHelper;
}
/**
* Sync ratings and reviews from Magento platform to Meta through feed upload API
*
* @return void
*/
public function execute()
{
foreach ($this->systemConfig->getAllFBEInstalledStores() as $store) {
$storeId = (int)$store->getId();
try {
if ($this->systemConfig->isCatalogSyncEnabled($storeId)) {
$this->ratingsAndReviewsFeedApi->execute($storeId);
}
} catch (\Throwable $e) {
$this->fbeHelper->logExceptionImmediatelyToMeta(
$e,
[
'store_id' => $storeId,
'event' => 'ratings_and_reviews_sync',
'event_type' => 'cron_job',
'catalog_id' => $this->systemConfig->getCatalogId($storeId),
]
);
}
}
}
}