24 private $metadataPool;
29 private $resourceConnection;
56 $this->metadataPool = $metadataPool;
59 $this->scopeConfig = $scopeConfig;
70 $metadata = $this->metadataPool->getMetadata(BulkSummaryInterface::class);
71 $connection = $this->resourceConnection->getConnectionByName($metadata->getEntityConnectionName());
73 $bulkLifetime = 3600 * 24 * (int)$this->scopeConfig->getValue(
'system/bulk/lifetime');
74 $maxBulkStartTime = $this->dateTime->formatDate($this->date->gmtTimestamp() - $bulkLifetime);
75 $connection->delete($metadata->getEntityTable(), [
'start_time <= ?' => $maxBulkStartTime]);
__construct(MetadataPool $metadataPool, ResourceConnection $resourceConnection, DateTime $dateTime, ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime\DateTime $time)