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

Public Member Functions

 __construct (ResourceMapper $fileMapper, FactoryInterface $fileFetcherFactory, DrupalFiles $drupalFiles, JobStoreFactory $jobStoreFactory)
 
 localize ($identifier, $version=NULL)
 
 getResult ($identifier, $version=NULL)
 
 getFileFetcher (Resource $resource)
 
 getFileSystem ()
 

Public Attributes

const LOCAL_FILE_PERSPECTIVE = 'local_file'
 
const LOCAL_URL_PERSPECTIVE = 'local_url'
 

Detailed Description

Resource localizer.

Todo:
Update fileMapper to resourceMapper.

Definition at line 24 of file ResourceLocalizer.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\datastore\Service\ResourceLocalizer::__construct ( ResourceMapper  $fileMapper,
FactoryInterface  $fileFetcherFactory,
DrupalFiles  $drupalFiles,
JobStoreFactory  $jobStoreFactory 
)

Constructor.

Definition at line 39 of file ResourceLocalizer.php.

Member Function Documentation

◆ getFileFetcher()

Drupal\datastore\Service\ResourceLocalizer::getFileFetcher ( Resource  $resource)

Get FileFetcher.

Definition at line 161 of file ResourceLocalizer.php.

◆ getFileSystem()

Drupal\datastore\Service\ResourceLocalizer::getFileSystem ( )

Get the Drupal filesystem service.

Returns
\Drupal\Core\File\FileSystemInterface Drupal filesystem.

Definition at line 192 of file ResourceLocalizer.php.

◆ getResult()

Drupal\datastore\Service\ResourceLocalizer::getResult (   $identifier,
  $version = NULL 
)

Get Result.

Definition at line 110 of file ResourceLocalizer.php.

◆ localize()

Drupal\datastore\Service\ResourceLocalizer::localize (   $identifier,
  $version = NULL 
)

Retriever the file and create a local copy of it.

Definition at line 49 of file ResourceLocalizer.php.

Member Data Documentation

◆ LOCAL_FILE_PERSPECTIVE

const Drupal\datastore\Service\ResourceLocalizer::LOCAL_FILE_PERSPECTIVE = 'local_file'

Definition at line 28 of file ResourceLocalizer.php.

◆ LOCAL_URL_PERSPECTIVE

const Drupal\datastore\Service\ResourceLocalizer::LOCAL_URL_PERSPECTIVE = 'local_url'

Definition at line 29 of file ResourceLocalizer.php.