function CurrentImportStorage::getOutdatedImports

Get projects due for an import check.

Parameters

array $projects: Projects to get.

int $requestTime: The timestamp to check since.

int $checkTime: The timestamp the check was queued.

Return value

array Array of projects and their languages.

File

core/modules/locale/src/CurrentImportStorage.php, line 139

Class

CurrentImportStorage
Provides the locale current import state service.

Namespace

Drupal\locale

Code

public function getOutdatedImports(array $projects, int $requestTime, int $checkTime) : ?array {
  $outdatedImports = [];
  $results = $this->database
    ->select('locale_file', 'f')
    ->condition('f.project', $projects, 'IN')
    ->condition('f.last_checked', $checkTime, '<')
    ->fields('f', [
    'project',
    'langcode',
  ])
    ->execute()
    ->fetchAll();
  foreach ($results as $result) {
    $outdatedImports[$result->project][] = $result->langcode;
    $this->updateLastChecked($result->project, $result->langcode, $requestTime);
  }
  return $outdatedImports;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.