class RemoveParagraphParentId in Acquia Content Hub 8.2
Subscribes to exclude Paragraph parent id.
Hierarchy
- class \Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField\ExcludeContentFieldBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField\RemoveParagraphParentId
Expanded class hierarchy of RemoveParagraphParentId
1 file declares its use of RemoveParagraphParentId
- RemoveParagraphParentIdTest.php in tests/
src/ Kernel/ EventSubscriber/ ExcludeContentField/ RemoveParagraphParentIdTest.php
1 string reference to 'RemoveParagraphParentId'
1 service uses RemoveParagraphParentId
File
- src/
EventSubscriber/ ExcludeContentField/ RemoveParagraphParentId.php, line 11
Namespace
Drupal\acquia_contenthub\EventSubscriber\ExcludeContentFieldView source
class RemoveParagraphParentId extends ExcludeContentFieldBase {
/**
* {@inheritdoc}
*/
public static $priority = 101;
/**
* {@inheritDoc}
*/
public function shouldExclude(ExcludeEntityFieldEvent $event) : bool {
$entity = $event
->getEntity();
return $entity instanceof Paragraph && $event
->getFieldName() === 'parent_id';
}
}
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. | |
RemoveParagraphParentId:: |
public static | property |
Priority of the subscriber. Overrides ExcludeContentFieldBase:: |
|
RemoveParagraphParentId:: |
public | function |
Prevent entity fields from being added to the serialized output. Overrides ExcludeContentFieldBase:: |