diff modules/contrib/migrate_plus/src/DataFetcherPluginInterface.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children a9cd425dd02b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/contrib/migrate_plus/src/DataFetcherPluginInterface.php	Thu Jul 05 14:24:15 2018 +0000
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\migrate_plus;
+
+/**
+ * Defines an interface for data fetchers.
+ *
+ * @see \Drupal\migrate_plus\Annotation\DataFetcher
+ * @see \Drupal\migrate_plus\DataFetchPluginBase
+ * @see \Drupal\migrate_plus\DataFetcherPluginManager
+ * @see plugin_api
+ */
+interface DataFetcherPluginInterface {
+
+  /**
+   * Set the client headers.
+   *
+   * @param $headers
+   *   An array of the headers to set on the HTTP request.
+   */
+  public function setRequestHeaders(array $headers);
+
+  /**
+   * Get the currently set request headers.
+   */
+  public function getRequestHeaders();
+
+  /**
+   * Return content.
+   *
+   * @param $url
+   *   URL to retrieve from.
+   *
+   * @return string
+   *   Content at the given url.
+   */
+  public function getResponseContent($url);
+
+  /**
+   * Return Http Response object for a given url.
+   *
+   * @param $url
+   *   URL to retrieve from.
+   *
+   * @return \Psr\Http\Message\ResponseInterface
+   */
+  public function getResponse($url);
+
+}