You are here

public function EditorNoteHelperService::getNoteFieldDefinition in Editor Notes 8

Returns field definition for a note.

Parameters

\Drupal\editor_note\Entity\EditorNote $editorNote: Editor note entity.

Return value

\Drupal\Core\Field\FieldDefinitionInterface Returns field definition object.

1 call to EditorNoteHelperService::getNoteFieldDefinition()
EditorNoteHelperService::getWidgetAjaxReplaceCommand in src/EditorNoteHelperService.php
Returns ajax replace command for refreshing field widget.

File

src/EditorNoteHelperService.php, line 168

Class

EditorNoteHelperService
Class EditorNoteHelperService.

Namespace

Drupal\editor_note

Code

public function getNoteFieldDefinition(EditorNote $editorNote) {
  $field_name = $editorNote->field_machine_name->value;
  $host_entity_type = $editorNote->entity_type->value;
  $host_entity_bundle = $editorNote->bundle->value;
  return FieldConfig::loadByName($host_entity_type, $host_entity_bundle, $field_name);
}