public function LicenseStorageInterface::createFromProductVariation in Commerce License 8.2
Creates a new license from a product variation.
Parameters
\Drupal\commerce_product\Entity\ProductVariationInterface $variation: The product variation. Values for the license will be taken from the license_type and license_expiration fields.
int $uid: The uid for whom the license will be created.
Return value
\Drupal\commerce_license\Entity\LicenseInterface A new, unsaved license entity, whose state is 'new'.
1 method overrides LicenseStorageInterface::createFromProductVariation()
- LicenseStorage::createFromProductVariation in src/
LicenseStorage.php - Creates a new license from a product variation.
File
- src/
LicenseStorageInterface.php, line 44
Class
- LicenseStorageInterface
- Defines the storage handler class for License entities.
Namespace
Drupal\commerce_licenseCode
public function createFromProductVariation(ProductVariationInterface $variation, $uid);