Open Data Catalog v2.0.0
Resource.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Contracts\FactoryInterface;
6 use Drupal\Core\Entity\EntityRepository;
7 use Drupal\Core\File\FileSystem;
10 
16 class Resource implements FactoryInterface {
17  private $entityRepository;
18  private $fileSystem;
19  private $jobStoreFactory;
20 
24  public function __construct(
25  EntityRepository $entityRepository,
26  FileSystem $fileSystem,
27  JobStoreFactory $jobStoreFactory
28  ) {
29  $this->entityRepository = $entityRepository;
30  $this->fileSystem = $fileSystem;
31  $this->jobStoreFactory = $jobStoreFactory;
32  }
33 
39  public function getInstance(string $identifier, array $config = []) {
40  if (!isset($this->services[$identifier])) {
41  $this->services[$identifier] = new Instance($identifier, $this->entityRepository, $this->fileSystem, $this->jobStoreFactory);
42  }
43 
44  return $this->services[$identifier];
45  }
46 
47 }
Drupal\dkan_datastore\Service\Factory\Resource\__construct
__construct(EntityRepository $entityRepository, FileSystem $fileSystem, JobStoreFactory $jobStoreFactory)
Definition: Resource.php:24
Drupal\dkan_datastore\Service\Factory\Resource
Definition: Resource.php:16
Drupal\dkan_datastore\Service\Resource
Definition: Resource.php:16
Drupal\dkan_datastore\Service\Factory\Resource\getInstance
getInstance(string $identifier, array $config=[])
Definition: Resource.php:39
Drupal\dkan_datastore\Service\Factory
Definition: Import.php:3
Drupal\dkan_datastore\Storage\JobStoreFactory
Definition: JobStoreFactory.php:11