You are here

public function ProductAttributesForm::buildForm in Ubercart 8.4

Form constructor.

Parameters

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

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

Return value

array The form structure.

Overrides FormInterface::buildForm

File

uc_attribute/src/Form/ProductAttributesForm.php, line 16

Class

ProductAttributesForm
Defines the product attribute overview form.

Namespace

Drupal\uc_attribute\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, NodeInterface $node = NULL) {
  $this->attributeTable = 'uc_product_attributes';
  $this->optionTable = 'uc_product_options';
  $this->idField = 'nid';
  $this->idValue = $node
    ->id();
  $this->attributes = uc_product_get_attributes($this->idValue);
  return parent::buildBaseForm($form, $form_state);
}