public static function TestEmbeddedEntityForm::processEmbeddedEntityForm

Process callback to embed an entity form.

Parameters

array $element: The containing element.

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

Return value

array The containing element, with the entity form inserted.

File

paragraphs/tests/modules/paragraphs_test/src/Form/TestEmbeddedEntityForm.php, line 97

Class

TestEmbeddedEntityForm
A class to build a form that embeds a content entity form.

Namespace

Drupal\paragraphs_test\Form

Code

public static function processEmbeddedEntityForm(array $element, FormStateInterface $form_state) {

  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  $entity = $element['#entity'];
  EntityFormDisplay::collectRenderDisplay($entity, 'default')
    ->buildForm($entity, $element, $form_state);
  return $element;
}