Open Data Catalog v2.0.0
Factory.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Contracts\Storage as ContractsStorageInterface;
6 use Sae\Sae;
7 use Symfony\Component\HttpFoundation\JsonResponse;
8 use Symfony\Component\HttpFoundation\Response;
9 
18 class Factory {
19 
32  public function newJsonResponse($data = NULL, $status = 200, array $headers = [], $json = FALSE) {
33  return new JsonResponse($data, $status, $headers, $json);
34  }
35 
48  public function newHttpResponse($content = '', $status = 200, array $headers = []) {
49  return Response::create($content, $status, $headers);
50  }
51 
63  public function newServiceApiEngine(ContractsStorageInterface $storage, string $jsonSchema) {
64  return new Sae($storage, $jsonSchema);
65  }
66 
67 }
Drupal\dkan_common\Service
Definition: Factory.php:3
Drupal\dkan_common\Service\Factory\newServiceApiEngine
newServiceApiEngine(ContractsStorageInterface $storage, string $jsonSchema)
Definition: Factory.php:63
Drupal\dkan_common\Service\Factory\newJsonResponse
newJsonResponse($data=NULL, $status=200, array $headers=[], $json=FALSE)
Definition: Factory.php:32
Drupal\dkan_common\Service\Factory\newHttpResponse
newHttpResponse($content='', $status=200, array $headers=[])
Definition: Factory.php:48
Drupal\dkan_common\Service\Factory
Definition: Factory.php:18