You are here

protected function BibciteEntityController::entityFormBuilder in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Controller/BibciteEntityController.php \Drupal\bibcite_entity\Controller\BibciteEntityController::entityFormBuilder()

Retrieves the entity form builder.

Return value

\Drupal\Core\Entity\EntityFormBuilderInterface The entity form builder.

Overrides ControllerBase::entityFormBuilder

File

modules/bibcite_entity/src/Controller/BibciteEntityController.php, line 37

Class

BibciteEntityController
Returns responses for Bibcite routes.

Namespace

Drupal\bibcite_entity\Controller

Code

protected function entityFormBuilder() {
  if (!$this->entityFormBuilder) {

    /* We use our form builder for saving entity in cache
     * on first form build. This is temporary patch for
     * entity form cache problem.
     *
     * @see https://www.drupal.org/project/drupal/issues/2824293
     *   Core issue.
     *
     * @see https://www.drupal.org/project/bibcite/issues/2930990
     *   Issue for this patch.
     *
     * @todo Remove after core fix.
     */
    $this->entityFormBuilder = $this
      ->container()
      ->get('reference_entity.form_builder');
  }
  return $this->entityFormBuilder;
}