You are here

public function ResourceResponseSubscriber::__construct in Drupal 10

Same name in this branch
  1. 10 core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::__construct()
  2. 10 core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::__construct()
Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::__construct()
  2. 9 core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::__construct()

Constructs a ResourceResponseSubscriber object.

Parameters

\Symfony\Component\Serializer\SerializerInterface $serializer: The serializer.

File

core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php, line 54

Class

ResourceResponseSubscriber
Response subscriber that serializes and removes ResourceResponses' data.

Namespace

Drupal\jsonapi\EventSubscriber

Code

public function __construct(SerializerInterface $serializer) {
  $this->serializer = $serializer;
}