Do not add the job if we have a filter match.
\Drupal\tmgmt\Events\ShouldCreateJobEvent $event: The event object.
public function onShouldCreateJob(ShouldCreateJobEvent $event) {
// Filter out content.
if ($event
->getPlugin() === 'content') {
$storage = $this->entityTypeManager
->getStorage($event
->getItemType());
$entity = $storage
->load($event
->getItemId());
if ($entity
->label() === static::DISALLOWED_LABEL) {
$event
->setShouldCreateItem(FALSE);
}
}
}