RemoveParagraphParentId.php in Acquia Content Hub 8.2
File
src/EventSubscriber/ExcludeContentField/RemoveParagraphParentId.php
View source
<?php
namespace Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField;
use Drupal\acquia_contenthub\Event\ExcludeEntityFieldEvent;
use Drupal\paragraphs\Entity\Paragraph;
class RemoveParagraphParentId extends ExcludeContentFieldBase {
public static $priority = 101;
public function shouldExclude(ExcludeEntityFieldEvent $event) : bool {
$entity = $event
->getEntity();
return $entity instanceof Paragraph && $event
->getFieldName() === 'parent_id';
}
}