delegateToRestResourcePlugin example


  public function handle(RouteMatchInterface $route_match, Request $request, RestResourceConfigInterface $_rest_resource_config) {
    $resource = $_rest_resource_config->getResourcePlugin();
    $unserialized = $this->deserialize($route_match$request$resource);
    $response = $this->delegateToRestResourcePlugin($route_match$request$unserialized$resource);
    return $this->prepareResponse($response$_rest_resource_config);
  }

  /** * Handles a REST API request without deserializing the request body. * * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match. * @param \Symfony\Component\HttpFoundation\Request $request * The HTTP request object. * @param \Drupal\rest\RestResourceConfigInterface $_rest_resource_config * The REST resource config entity. * * @return \Symfony\Component\HttpFoundation\Response|\Drupal\rest\ResourceResponseInterface * The REST resource response. */
Home | Imprint | This part of the site doesn't use cookies.