You are here

protected function EntityDisplayTrait::getFormDisplays in CCK Select Other 8

Get the entity form displays for a field definition.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface $definition: The field definition to use.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityManager: The entity manager for getting entities from storage.

Return value

\Drupal\Core\Entity\EntityInterface[]|null An array of entity form displays.

2 calls to EntityDisplayTrait::getFormDisplays()
EntityDisplayTrait::getWidgetSettings in src/EntityDisplayTrait.php
Get the select other widget settings from the form display.
EntityDisplayTrait::hasSelectOtherWidget in src/EntityDisplayTrait.php
Determine if a field has the select other widget configured.

File

src/EntityDisplayTrait.php, line 35

Class

EntityDisplayTrait
Provides methods for dealing with entity displays.

Namespace

Drupal\cck_select_other

Code

protected function getFormDisplays(FieldDefinitionInterface $definition, EntityTypeManagerInterface $entityManager) {
  $params = [
    'targetEntityType' => $definition
      ->getTargetEntityTypeId(),
  ];
  return $entityManager
    ->getStorage('entity_form_display')
    ->loadByProperties($params);
}