Open Data Catalog v2.0.0
Drupal\dkan_datastore\Service\Resource Class Reference

Public Member Functions

 __construct (string $uuid, EntityRepository $entityRepository, FileSystem $fileSystem, JobStoreFactory $jobStoreFactory)
 
 get ($useFileFetcher=FALSE, $runFileFetcher=TRUE)
 
 remove ()
 
 getResult ()
 
 getFileFetcher ()
 

Public Attributes

const DEFAULT_TIMELIMIT = 50
 

Protected Member Functions

 getFileFetcherInstance ($filePath, $tmpDirectory)
 

Detailed Description

Class Resource.

Definition at line 16 of file Resource.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\dkan_datastore\Service\Resource::__construct ( string  $uuid,
EntityRepository  $entityRepository,
FileSystem  $fileSystem,
JobStoreFactory  $jobStoreFactory 
)

Constructor.

Definition at line 27 of file Resource.php.

Member Function Documentation

◆ get()

Drupal\dkan_datastore\Service\Resource::get (   $useFileFetcher = FALSE,
  $runFileFetcher = TRUE 
)

Create a resource object.

Parameters
bool$useFileFetcherIf file fetcher was used, get path from the file fetcher.
bool$runFileFetcherIf file fetcher was used, run it.
Returns
\Dkan\Datastore\Resource Datastore resource object.

Definition at line 50 of file Resource.php.

◆ getFileFetcher()

Drupal\dkan_datastore\Service\Resource::getFileFetcher ( )

Get FileFetcher.

Definition at line 106 of file Resource.php.

◆ getFileFetcherInstance()

Drupal\dkan_datastore\Service\Resource::getFileFetcherInstance (   $filePath,
  $tmpDirectory 
)
protected

Protected.

@codeCoverageIgnore

Definition at line 94 of file Resource.php.

◆ getResult()

Drupal\dkan_datastore\Service\Resource::getResult ( )

Get result.

Definition at line 84 of file Resource.php.

◆ remove()

Drupal\dkan_datastore\Service\Resource::remove ( )

Remove the resource object.

Resource objects are dynamic, so they themselves do not need to be removed. However, to create a resource we use the filefetcher. Filefetcher states are stored, and once fetching is finished a file exists in the file system. We need to clean up both of those things.

Definition at line 72 of file Resource.php.

Member Data Documentation

◆ DEFAULT_TIMELIMIT

const Drupal\dkan_datastore\Service\Resource::DEFAULT_TIMELIMIT = 50

Definition at line 17 of file Resource.php.