037cd4bcb8ea4acbd8bc7bc5c94e11df6967b913
[yaffs-website] / web / modules / contrib / media_entity_twitter / src / TweetFetcherInterface.php
1 <?php
2
3 namespace Drupal\media_entity_twitter;
4
5 /**
6  * Defines a wrapper around the Twitter API.
7  */
8 interface TweetFetcherInterface {
9
10   /**
11    * Retrieves a tweet by its ID.
12    *
13    * @param int $id
14    *   The tweet ID.
15    *
16    * @return array
17    *   The tweet information.
18    *
19    * @throws \Drupal\media_entity_twitter\Exception\TwitterApiException
20    *   If the Twitter API returns errors in the response.
21    */
22   public function fetchTweet($id);
23
24   /**
25    * Returns the current Twitter API credentials.
26    *
27    * @return array
28    *   The API credentials. Will be an array with consumer_key, consumer_secret,
29    *   oauth_access_token, and oauth_access_token_secret elements.
30    */
31   public function getCredentials();
32
33   /**
34    * Sets the credentials for accessing Twitter's API.
35    *
36    * @param string $consumer_key
37    *   The consumer key.
38    * @param string $consumer_secret
39    *   The consumer secret.
40    * @param string $oauth_access_token
41    *   The OAuth access token.
42    * @param string $oauth_access_token_secret
43    *   The OAuth access token secret.
44    */
45   public function setCredentials($consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret);
46
47 }