protected function Cron::getLicensesToExpire in Commerce License 8.2
Gets IDs of licenses that are set to expire.
Parameters
int $time: Time to check against license expiration.
Return value
array IDs of matching commerce_license entities.
File
- src/
Cron.php, line 71
Class
- Cron
- Default cron implementation.
Namespace
Drupal\commerce_licenseCode
protected function getLicensesToExpire($time) {
// Get all of the active expired licenses.
$query = $this->entityTypeManager
->getStorage('commerce_license')
->getQuery()
->condition('state', 'active')
->condition('expires', $time, '<=')
->condition('expires', 0, '<>');
$license_ids = $query
->execute();
return $license_ids;
}