You are here

interface TweetFetcherInterface in Media entity Twitter 8.2

Same name and namespace in other branches
  1. 8 src/TweetFetcherInterface.php \Drupal\media_entity_twitter\TweetFetcherInterface

Defines a wrapper around the Twitter API.

Hierarchy

Expanded class hierarchy of TweetFetcherInterface

All classes that implement TweetFetcherInterface

2 files declare their use of TweetFetcherInterface
ThumbnailTest.php in tests/src/Kernel/ThumbnailTest.php
Twitter.php in src/Plugin/media/Source/Twitter.php

File

src/TweetFetcherInterface.php, line 8

Namespace

Drupal\media_entity_twitter
View source
interface TweetFetcherInterface {

  /**
   * Retrieves a tweet by its ID.
   *
   * @param int $id
   *   The tweet ID.
   *
   * @return array
   *   The tweet information.
   *
   * @throws \Drupal\media_entity_twitter\Exception\TwitterApiException
   *   If the Twitter API returns errors in the response.
   */
  public function fetchTweet($id);

  /**
   * Returns the current Twitter API credentials.
   *
   * @return array
   *   The API credentials. Will be an array with consumer_key, consumer_secret,
   *   oauth_access_token, and oauth_access_token_secret elements.
   */
  public function getCredentials();

  /**
   * Sets the credentials for accessing Twitter's API.
   *
   * @param string $consumer_key
   *   The consumer key.
   * @param string $consumer_secret
   *   The consumer secret.
   * @param string $oauth_access_token
   *   The OAuth access token.
   * @param string $oauth_access_token_secret
   *   The OAuth access token secret.
   */
  public function setCredentials($consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret);

}

Members

Namesort descending Modifiers Type Description Overrides
TweetFetcherInterface::fetchTweet public function Retrieves a tweet by its ID. 1
TweetFetcherInterface::getCredentials public function Returns the current Twitter API credentials. 1
TweetFetcherInterface::setCredentials public function Sets the credentials for accessing Twitter's API. 1