You are here

public function FieldUtilsTrait::getFieldDefinition in Scheduled Updates 8

Get field definition on bundle.

Parameters

$entity_type_id:

$bundle:

$field_name:

Return value

\Drupal\Core\Field\FieldDefinitionInterface|null

2 calls to FieldUtilsTrait::getFieldDefinition()
FieldManager::getAllFieldConfigsForField in src/FieldManager.php
Get all the instances of field for an entity type.
ScheduledUpdateTypeBaseForm::cloneSingleField in src/Form/ScheduledUpdateTypeBaseForm.php
Clone a single field from the settings on type add form.

File

src/FieldUtilsTrait.php, line 188
Contains \Drupal\scheduled_updates\FieldUtilsTrait.

Class

FieldUtilsTrait

Namespace

Drupal\scheduled_updates

Code

public function getFieldDefinition($entity_type_id, $bundle, $field_name) {
  $bundle_definitions = $this
    ->FieldManager()
    ->getFieldDefinitions($entity_type_id, $bundle);
  if (isset($bundle_definitions[$field_name])) {
    return $bundle_definitions[$field_name];
  }
  return NULL;
}