You are here

RemoveRevisionField.php in Acquia Content Hub 8.2

File

src/EventSubscriber/ExcludeContentField/RemoveRevisionField.php
View source
<?php

namespace Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField;

use Drupal\acquia_contenthub\Event\ExcludeEntityFieldEvent;

/**
 * Subscribes to exclude entity revision field.
 */
class RemoveRevisionField extends ExcludeContentFieldBase {

  /**
   * {@inheritdoc}
   */
  public static $priority = 110;

  /**
   * {@inheritDoc}
   */
  public function shouldExclude(ExcludeEntityFieldEvent $event) : bool {
    $entity_type = $event
      ->getEntity()
      ->getEntityType();
    return $event
      ->getFieldName() === $entity_type
      ->getKey('revision');
  }

}

Classes

Namesort descending Description
RemoveRevisionField Subscribes to exclude entity revision field.