function CurrentImport::createFromFile

Creates a CurrentImport from a LocaleFile.

Parameters

\Drupal\locale\File\LocaleFile $file: The LocaleFile containing the primer information.

Return value

self The CurrentImport object.

1 call to CurrentImport::createFromFile()
LocaleImportBatch::batchSave in core/modules/locale/src/LocaleImportBatch.php
Implements callback_batch_operation().

File

core/modules/locale/src/CurrentImport.php, line 48

Class

CurrentImport
Represents information about the current import status.

Namespace

Drupal\locale

Code

public static function createFromFile(LocaleFile $file) : self {
  $currentImport = new CurrentImport($file->project, $file->langcode, $file->version, $file->hash, $file->timestamp, $file->last_checked ?? NULL);
  return $currentImport;
}

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