You are here

function commerce_bulk_commerce_bulk_attribute_value_alter in Commerce Bulk 8

Implements hook_TYPE_alter().

Allows to alter an attribute value fields data.

See also

\Drupal\commerce_bulk\Plugin\Action\AttributeValueName::submitConfigurationForm()

File

./commerce_bulk.module, line 60
Contains commerce_bulk.module.

Code

function commerce_bulk_commerce_bulk_attribute_value_alter(ProductAttributeValueInterface &$attribute, &$name, $data) {

  // Do required changes optionally using $data passed.
  // Enable core `Serialization' module to decode 'json' or 'xml' data passed on
  // the VBO action configuration page and use that to alter $attribute / $name:
  // static $array_data;
  // $array_data = $array_data ?: \Drupal::service('serializer')->decode($data, 'json');
  // Note that $attribute will be saved later by the hook caller.
}