You are here

protected function Pattern::isSupportedField in UI Patterns 8

Pattern Display Suite field template plugin only supports actual fields.

Parameters

array $context: Current context.

Return value

bool TRUE if supported, FALSE otherwise.

1 call to Pattern::isSupportedField()
Pattern::alterForm in modules/ui_patterns_ds/src/Plugin/DsFieldTemplate/Pattern.php

File

modules/ui_patterns_ds/src/Plugin/DsFieldTemplate/Pattern.php, line 181

Class

Pattern
Plugin for the expert field template.

Namespace

Drupal\ui_patterns_ds\Plugin\DsFieldTemplate

Code

protected function isSupportedField(array $context) {

  /** @var \Drupal\field\Entity\FieldConfig $field */
  if ($context['entity_type'] && $context['bundle']) {
    $field = $this->fieldManager
      ->getFieldDefinitions($context['entity_type'], $context['bundle']);
    return isset($field[$context['field_name']]);
  }
  return FALSE;
}