You are here

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.

1 call to Cron::getLicensesToExpire()
Cron::run in src/Cron.php
Runs the cron.

File

src/Cron.php, line 71

Class

Cron
Default cron implementation.

Namespace

Drupal\commerce_license

Code

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;
}