public function onResponse(FilterResponseEvent $event) {
    $response = $event->getResponse();

    $node = $this->getObject($response, 'node');

    if ($node === FALSE) {
      return;
    }

    $links = array_merge(
      $this->generateEntityReferenceLinks($node),
      $this->generateRelatedMediaLinks($node),
      $this->generateRestLinks($node)
    );

    // Add the link headers to the response.
    if (empty($links)) {
      return;
    }

    $response->headers->set('Link', $links, FALSE);
  }
public function onResponse(FilterResponseEvent $event) {
    $response = $event->getResponse();

    $node = $this->getObject($response, 'node');

    if ($node === FALSE) {
      return;
    }

    $links = array_merge(
      $this->generateEntityReferenceLinks($node),
      $this->generateRelatedMediaLinks($node),
      $this->generateRestLinks($node)
    );

    // Add the link headers to the response.
    if (empty($links)) {
      return;
    }

    $response->headers->set('Link', $links, FALSE);
  }
public function onResponse ( FilterResponseEvent $ event ) { $ response = $ event -> getResponse ( ) ; $ node = $ this -> getObject ( $ response , 'node' ) ; if ( $ node === FALSE ) { return ; } $ links = array_merge ( $ this -> generateEntityReferenceLinks ( $ node ) , $ this -> generateRelatedMediaLinks ( $ node ) , $ this -> generateRestLinks ( $ node ) ) ; // Add the link headers to the response. if ( empty ( $ links ) ) { return ; } $ response -> headers -> set ( 'Link' , $ links , FALSE ) ; }
Adds node-specific link headers to appropriate responses.

@param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
Event containing the response.
Adds node - specific link headers to appropriate responses .