public function LicenseStateChangeTest::grantLicense in Commerce License 8.2
Reacts to the license being activated.
The license's privileges should be granted to 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::grantLicense
File
- tests/
modules/ commerce_license_test/ src/ Plugin/ Commerce/ LicenseType/ LicenseStateChangeTest.php, line 20
Class
- LicenseStateChangeTest
- Provides a test license type.
Namespace
Drupal\commerce_license_test\Plugin\Commerce\LicenseTypeCode
public function grantLicense(LicenseInterface $license) {
$state = \Drupal::state();
$state
->set('commerce_license_state_change_test', 'grantLicense');
}