You are here

public function StateChangeWithRightsCheck::revokeLicense in Commerce License 8.2

Reacts to the license being revoked.

The license's privileges should be removed from its user. This is called during preSave(), so values may be set on the license entity.

Parameters

\Drupal\commerce_license\Entity\LicenseInterface $license: The license entity.

Overrides TestLicenseBase::revokeLicense

File

tests/modules/commerce_license_test/src/Plugin/Commerce/LicenseType/StateChangeWithRightsCheck.php, line 31

Class

StateChangeWithRightsCheck
Reports whether it has been granted and has a rights check.

Namespace

Drupal\commerce_license_test\Plugin\Commerce\LicenseType

Code

public function revokeLicense(LicenseInterface $license) {
  $state = \Drupal::state();
  $state
    ->set('commerce_license_state_change_test', 'revokeLicense');
}