You are here

protected function DepCalcExcludeLingotekContentMetadataSubscriber::includeField in Lingotek Translation 4.0.x

Same name and namespace in other branches
  1. 3.6.x src/EventSubscriber/DepCalcExcludeLingotekContentMetadataSubscriber.php \Drupal\lingotek\EventSubscriber\DepCalcExcludeLingotekContentMetadataSubscriber::includeField()
  2. 3.7.x src/EventSubscriber/DepCalcExcludeLingotekContentMetadataSubscriber.php \Drupal\lingotek\EventSubscriber\DepCalcExcludeLingotekContentMetadataSubscriber::includeField()
  3. 3.8.x src/EventSubscriber/DepCalcExcludeLingotekContentMetadataSubscriber.php \Drupal\lingotek\EventSubscriber\DepCalcExcludeLingotekContentMetadataSubscriber::includeField()

Whether we should include this field in the dependency calculation.

Parameters

\Drupal\Core\Field\FieldItemListInterface $field: The entity field.

Return value

bool TRUE if we should include the field, FALSE otherwise.

1 call to DepCalcExcludeLingotekContentMetadataSubscriber::includeField()
DepCalcExcludeLingotekContentMetadataSubscriber::onFilterFields in src/EventSubscriber/DepCalcExcludeLingotekContentMetadataSubscriber.php
Filter fields.

File

src/EventSubscriber/DepCalcExcludeLingotekContentMetadataSubscriber.php, line 46

Class

DepCalcExcludeLingotekContentMetadataSubscriber

Namespace

Drupal\lingotek\EventSubscriber

Code

protected function includeField(FieldItemListInterface $field) {
  $definition = $field
    ->getFieldDefinition();
  if ($definition
    ->getType() === 'entity_reference' && $field
    ->getSetting('target_type') === 'lingotek_content_metadata') {
    return FALSE;
  }
  return TRUE;
}