Purge.php in Acquia Content Hub 8.2
File
modules/acquia_contenthub_publisher/src/EventSubscriber/HandleWebhook/Purge.php
View source
<?php
namespace Drupal\acquia_contenthub_publisher\EventSubscriber\HandleWebhook;
use Drupal\acquia_contenthub\EventSubscriber\HandleWebhook\PurgeBase;
use Drupal\Core\Database\Connection;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Queue\QueueFactory;
class Purge extends PurgeBase {
protected $database;
public function __construct(QueueFactory $queue_factory, LoggerChannelInterface $logger_channel, Connection $database) {
parent::__construct($queue_factory, $logger_channel);
$this->database = $database;
}
protected function getQueueName() : string {
return 'acquia_contenthub_publish_export';
}
protected function onPurgeSuccessful() {
parent::onPurgeSuccessful();
$this->database
->truncate('acquia_contenthub_publisher_export_tracking')
->execute();
$this->logger
->info('Database table "acquia_contenthub_publisher_export_tracking" has been truncated successfully.');
}
}