You are here

public function ProductAttributeTranslationAddForm::buildForm in Commerce Core 8.2

Implements \Drupal\Core\Form\FormInterface::buildForm().

Builds configuration form with metadata and values from the source language.

Parameters

array $form: An associative array containing the structure of the form.

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

\Drupal\Core\Routing\RouteMatchInterface $route_match: (optional) The route match.

string $plugin_id: (optional) The plugin ID of the mapper.

string $langcode: (optional) The language code of the language the form is adding or editing.

Return value

array The form structure.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException Throws an exception if the language code provided as a query parameter in the request does not match an active language.

Overrides ConfigTranslationAddForm::buildForm

File

modules/product/src/Form/ProductAttributeTranslationAddForm.php, line 59

Class

ProductAttributeTranslationAddForm
Provides the form for adding product attribute translations.

Namespace

Drupal\commerce_product\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, RouteMatchInterface $route_match = NULL, $plugin_id = NULL, $langcode = NULL) {
  $form = parent::buildForm($form, $form_state, $route_match, $plugin_id, $langcode);
  $form = $this
    ->buildValuesForm($form, $form_state, $this->mapper
    ->getEntity());
  return $form;
}