You are here

protected function ModalForm::getEditorNoteEntity in Editor Notes 8

Returns current EditorNote entity.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

Return value

\Drupal\editor_note\Entity\EditorNote|null Editor note entity.

2 calls to ModalForm::getEditorNoteEntity()
ModalForm::ajaxSubmitForm in src/Form/ModalForm.php
Implements the submit handler for the modal dialog AJAX call.
ModalForm::submitForm in src/Form/ModalForm.php
Updates EditorNote entity.

File

src/Form/ModalForm.php, line 96

Class

ModalForm
Implements the ModalForm form controller.

Namespace

Drupal\editor_note\Form

Code

protected function getEditorNoteEntity(FormStateInterface $form_state) {
  $editor_note = NULL;
  $build_info = $form_state
    ->getBuildInfo();
  if (!empty($build_info['args'][0])) {
    if ($build_info['args'][0] instanceof EditorNote) {
      $editor_note = $build_info['args'][0];
    }
  }
  return $editor_note;
}