Open Data Catalog v2.0.0
Drupal\datastore\Service\Info\ImportInfo Class Reference

Public Member Functions

 __construct (JobStoreFactory $jobStoreFactory, ResourceLocalizer $resourceLocalizer, ImportFactoryInterface $importServiceFactory)
 

Protected Member Functions

 getFileFetcherAndImporter ($identifier, $version)
 
 getFileSize ()
 
 getBytesProcessed (Job $job)
 

Detailed Description

Defines and provide a single item for an ImportInfoList.

Definition at line 15 of file ImportInfo.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\datastore\Service\Info\ImportInfo::__construct ( JobStoreFactory  $jobStoreFactory,
ResourceLocalizer  $resourceLocalizer,
ImportFactoryInterface  $importServiceFactory 
)

Constructor.

Definition at line 48 of file ImportInfo.php.

Member Function Documentation

◆ getBytesProcessed()

Drupal\datastore\Service\Info\ImportInfo::getBytesProcessed ( Job  $job)
protected

Calculate bytes processed based on chunks processed in the importer data.

Parameters
\Procrastinator\Job\Job$jobEither a FileFetcher or Importer object.
Returns
int Total bytes processed.

Definition at line 170 of file ImportInfo.php.

◆ getFileFetcherAndImporter()

Drupal\datastore\Service\Info\ImportInfo::getFileFetcherAndImporter (   $identifier,
  $version 
)
protected

Get the filefetcher and importer objects for a resource.

Parameters
string$identifierResource identifier.
string$versionResource version.
Returns
array Array with a filefetcher and importer object.

Definition at line 109 of file ImportInfo.php.

◆ getFileSize()

Drupal\datastore\Service\Info\ImportInfo::getFileSize ( )
protected

Get the filesize for the resource file.

Returns
int File size in bytes.

Definition at line 157 of file ImportInfo.php.