You are here

public function ExcludeContentFieldBase::excludeContentField in Acquia Content Hub 8.2

Sets the "exclude" flag.

Parameters

\Drupal\acquia_contenthub\Event\ExcludeEntityFieldEvent $event: The content entity field serialization event.

File

src/EventSubscriber/ExcludeContentField/ExcludeContentFieldBase.php, line 49

Class

ExcludeContentFieldBase
Class ExcludeContentFieldBase.

Namespace

Drupal\acquia_contenthub\EventSubscriber\ExcludeContentField

Code

public function excludeContentField(ExcludeEntityFieldEvent $event) {
  if ($this
    ->shouldExclude($event)) {
    $event
      ->exclude();
    $event
      ->stopPropagation();
  }
}