You are here

interface RobohashInterface in Avatar Kit 8

Provides an interface to the Robohash.org API.

Hierarchy

Expanded class hierarchy of RobohashInterface

All classes that implement RobohashInterface

File

avatars_robohash/src/RobohashInterface.php, line 8

Namespace

Drupal\avatars_robohash
View source
interface RobohashInterface {

  /*
   * URL for insecure requests.
   *
   * @var string
   */
  const ROBOHASH_HOSTNAME = 'robohash.org';

  /*
   * Maximum width images output by the endpoint.
   *
   * @var int
   */
  const DIMENSION_MAXIMUM_WIDTH = 300;

  /*
   * Maximum height images output by the endpoint.
   *
   * @var int
   */
  const DIMENSION_MAXIMUM_HEIGHT = 300;

  /*
   * Minimum width images output by the endpoint.
   *
   * @var int
   */
  const DIMENSION_MINIMUM_WIDTH = 1;

  /*
   * Minimum height images output by the endpoint.
   *
   * @var int
   */
  const DIMENSION_MINIMUM_HEIGHT = 1;

  /**
   * A list of valid backgrounds.
   *
   * @return array
   *   An array of background labels keyed by background.
   */
  public static function getBackgrounds();

  /**
   * Backgrounds mapped to GET values.
   *
   * @return array
   *   An array of GET values keyed by background.
   */
  public static function getBackgroundsMap();

  /**
   * Gets the background.
   *
   * @return string|null
   *   The background, or NULL for default.
   */
  public function getBackground();

  /**
   * Set the background.
   *
   * @param string|null $background
   *   The background to use, or NULL to use default.
   *
   * @return \Drupal\avatars_robohash\RobohashInterface
   *   Returns the called Robohash object for chaining.
   */
  public function setBackground($background = NULL);

  /**
   * Avatar types mapped to GET values.
   *
   * @return array
   *   An array of GET values keyed by type.
   */
  public static function getTypesMap();

  /**
   * Sets type to random.
   *
   * Will not be random for each request, rather for each identifier.
   *
   * @return \Drupal\avatars_robohash\RobohashInterface
   *   Returns the called Robohash object for chaining.
   */
  public function setTypeRandom();

}

Members

Namesort descending Modifiers Type Description Overrides
RobohashInterface::DIMENSION_MAXIMUM_HEIGHT constant
RobohashInterface::DIMENSION_MAXIMUM_WIDTH constant
RobohashInterface::DIMENSION_MINIMUM_HEIGHT constant
RobohashInterface::DIMENSION_MINIMUM_WIDTH constant
RobohashInterface::getBackground public function Gets the background. 1
RobohashInterface::getBackgrounds public static function A list of valid backgrounds. 1
RobohashInterface::getBackgroundsMap public static function Backgrounds mapped to GET values. 1
RobohashInterface::getTypesMap public static function Avatar types mapped to GET values. 1
RobohashInterface::ROBOHASH_HOSTNAME constant
RobohashInterface::setBackground public function Set the background. 1
RobohashInterface::setTypeRandom public function Sets type to random. 1