class TrackTotals in Acquia Content Hub 8.2
Same name in this branch
- 8.2 modules/acquia_contenthub_subscriber/src/EventSubscriber/PromoteEntityStatusTrack/TrackTotals.php \Drupal\acquia_contenthub_subscriber\EventSubscriber\PromoteEntityStatusTrack\TrackTotals
- 8.2 modules/acquia_contenthub_publisher/src/EventSubscriber/PromoteEntityStatusTrack/TrackTotals.php \Drupal\acquia_contenthub_publisher\EventSubscriber\PromoteEntityStatusTrack\TrackTotals
Class TrackTotals to track published entities in the client CDF object.
@package Drupal\acquia_contenthub_publisher\EventSubscriber\PromoteEntityStatusTrack
Hierarchy
- class \Drupal\acquia_contenthub_publisher\EventSubscriber\PromoteEntityStatusTrack\TrackTotals implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of TrackTotals
1 string reference to 'TrackTotals'
- acquia_contenthub_publisher.services.yml in modules/
acquia_contenthub_publisher/ acquia_contenthub_publisher.services.yml - modules/acquia_contenthub_publisher/acquia_contenthub_publisher.services.yml
1 service uses TrackTotals
File
- modules/
acquia_contenthub_publisher/ src/ EventSubscriber/ PromoteEntityStatusTrack/ TrackTotals.php, line 15
Namespace
Drupal\acquia_contenthub_publisher\EventSubscriber\PromoteEntityStatusTrackView source
class TrackTotals implements EventSubscriberInterface {
/**
* Keep track of the tracker table.
*
* @var \Drupal\acquia_contenthub_publisher\PublisherTracker
*/
protected $tracker;
/**
* TrackTotals constructor.
*
* @param \Drupal\acquia_contenthub_publisher\PublisherTracker $tracker
* Publisher tracker.
*/
public function __construct(PublisherTracker $tracker) {
$this->tracker = $tracker;
}
/**
* Retrieve subscribed events.
*
* @return array
* Array of subscribed events.
*/
public static function getSubscribedEvents() : array {
return [
AcquiaContentHubEvents::BUILD_CLIENT_CDF => 'onPromotePublisherEntityStatusTrackTotals',
];
}
/**
* Event Handler onPromotePublisherEntityStatusTrackTotals.
*
* @param \Drupal\acquia_contenthub\Event\BuildClientCdfEvent $event
* The build client cdf event data.
*/
public function onPromotePublisherEntityStatusTrackTotals(BuildClientCdfEvent $event) : void {
$cdf = $event
->getCdf();
$metadata = $cdf
->getMetadata();
$metadata['metrics']['publisher'] = $this->tracker
->getStatusMetrics($this->tracker::EXPORT_TRACKING_TABLE, 'modified');
$cdf
->setMetadata($metadata);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TrackTotals:: |
protected | property | Keep track of the tracker table. | |
TrackTotals:: |
public static | function | Retrieve subscribed events. | |
TrackTotals:: |
public | function | Event Handler onPromotePublisherEntityStatusTrackTotals. | |
TrackTotals:: |
public | function | TrackTotals constructor. |