You are here

public function TaxNumberItem::onChange in Commerce Core 8.2

Parameters

bool $notify: (optional) Whether to forward the notification to the parent. Defaults to TRUE. By passing FALSE, overrides of this method can re-use the logic of parent classes without triggering notification.

Overrides Map::onChange

File

modules/tax/src/Plugin/Field/FieldType/TaxNumberItem.php, line 187

Class

TaxNumberItem
Plugin implementation of the 'commerce_tax_number' field type.

Namespace

Drupal\commerce_tax\Plugin\Field\FieldType

Code

public function onChange($property_name, $notify = TRUE) {
  if ($property_name == 'type') {

    // Make sure the number is re-verified after the type is changed.
    $this
      ->writePropertyValue('verification_state', NULL);
    $this
      ->writePropertyValue('verification_timestamp', NULL);
    $this
      ->writePropertyValue('verification_result', NULL);
  }
  parent::onChange($property_name, $notify);
}