You are here

protected function TestController::attachClassOption in Dropdown Attributes 8

Attach an option to a product class.

Parameters

int $oid: Option ID.

int $pcid: Product class ID.

2 calls to TestController::attachClassOption()
TestController::productClass in uc_dropdown_test/src/Controller/TestController.php
TestController::productKit in uc_dropdown_test/src/Controller/TestController.php

File

uc_dropdown_test/src/Controller/TestController.php, line 618

Class

TestController
Additional test of Dropdown Attributes UI.

Namespace

Drupal\uc_dropdown_test\Controller

Code

protected function attachClassOption($oid, $pcid) {
  \Drupal::database()
    ->merge('uc_class_attribute_options')
    ->key(array(
    'pcid' => $pcid,
    'oid' => $oid,
  ))
    ->fields(array(
    'cost' => 0.0,
    'price' => 0.0,
    'weight' => 0,
    'ordering' => 0,
  ))
    ->execute();
}