Drupal investigation

DataFetcherPluginInterface.php 977B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Drupal\migrate_plus;
  3. /**
  4. * Defines an interface for data fetchers.
  5. *
  6. * @see \Drupal\migrate_plus\Annotation\DataFetcher
  7. * @see \Drupal\migrate_plus\DataFetchPluginBase
  8. * @see \Drupal\migrate_plus\DataFetcherPluginManager
  9. * @see plugin_api
  10. */
  11. interface DataFetcherPluginInterface {
  12. /**
  13. * Set the client headers.
  14. *
  15. * @param $headers
  16. * An array of the headers to set on the HTTP request.
  17. */
  18. public function setRequestHeaders(array $headers);
  19. /**
  20. * Get the currently set request headers.
  21. */
  22. public function getRequestHeaders();
  23. /**
  24. * Return content.
  25. *
  26. * @param $url
  27. * URL to retrieve from.
  28. *
  29. * @return string
  30. * Content at the given url.
  31. */
  32. public function getResponseContent($url);
  33. /**
  34. * Return Http Response object for a given url.
  35. *
  36. * @param $url
  37. * URL to retrieve from.
  38. *
  39. * @return \Psr\Http\Message\ResponseInterface
  40. */
  41. public function getResponse($url);
  42. }