public function ProductAttributesAddForm::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/ ProductAttributesAddForm.php, line 16
Class
- ProductAttributesAddForm
- Defines the product attribute add form.
Namespace
Drupal\uc_attribute\FormCode
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);
}