class RemoveRevisionField in Acquia Content Hub 8.2
Subscribes to exclude entity revision field.
Hierarchy
- class \Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField\ExcludeContentFieldBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField\RemoveRevisionField
Expanded class hierarchy of RemoveRevisionField
1 file declares its use of RemoveRevisionField
- RemoveRevisionFieldTest.php in tests/
src/ Kernel/ EventSubscriber/ ExcludeContentField/ RemoveRevisionFieldTest.php
1 string reference to 'RemoveRevisionField'
1 service uses RemoveRevisionField
File
- src/
EventSubscriber/ ExcludeContentField/ RemoveRevisionField.php, line 10
Namespace
Drupal\acquia_contenthub\EventSubscriber\ExcludeContentFieldView source
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');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExcludeContentFieldBase:: |
public | function | Sets the "exclude" flag. | |
ExcludeContentFieldBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
RemoveRevisionField:: |
public static | property |
Priority of the subscriber. Overrides ExcludeContentFieldBase:: |
|
RemoveRevisionField:: |
public | function |
Prevent entity fields from being added to the serialized output. Overrides ExcludeContentFieldBase:: |