You are here

public static function BackgroundImageForm::create in Background Image 8

Same name and namespace in other branches
  1. 2.x src/Form/BackgroundImageForm.php \Drupal\background_image\Form\BackgroundImageForm::create()
  2. 2.0.x src/Form/BackgroundImageForm.php \Drupal\background_image\Form\BackgroundImageForm::create()

Parameters

\Drupal\background_image\BackgroundImageInterface $background_image:

array $complete_form:

\Drupal\Core\Form\FormStateInterface $form_state:

array $subform:

Return value

\Drupal\background_image\Form\BackgroundImageForm

File

src/Form/BackgroundImageForm.php, line 87

Class

BackgroundImageForm

Namespace

Drupal\background_image\Form

Code

public static function create(BackgroundImageInterface $background_image, array &$complete_form, FormStateInterface $form_state, array &$subform) {
  $self = $form_state
    ->get(self::class);
  if (!$self) {
    $self = new self();
    $form_state
      ->set(self::class, $self);
  }
  return $self
    ->setInlineEntity($form_state
    ->get('inline_entity_form_entity'))
    ->setBackgroundImage($background_image)
    ->setSubform($subform)
    ->setForm($complete_form)
    ->setFormState($form_state);
}