interface GravatarInterface in Avatar Kit 8
Provides an interface for the Gravatar.com API.
Hierarchy
- interface \Drupal\avatars_gravatar\GravatarInterface
Expanded class hierarchy of GravatarInterface
All classes that implement GravatarInterface
File
- avatars_gravatar/
src/ GravatarInterface.php, line 8
Namespace
Drupal\avatars_gravatarView source
interface GravatarInterface {
/*
* URL for insecure requests.
*
* @var string
*/
const GRAVATAR_HOSTNAME = 'gravatar.com';
/*
* URL for secure requests.
*
* @var string
*/
const GRAVATAR_HOSTNAME_SECURE = 'secure.gravatar.com';
/*
* Minimum width images output by the endpoint.
*
* @var int
*/
const DIMENSION_MINIMUM_WIDTH = 1;
/*
* Maximum width images output by the endpoint.
*
* @var int
*/
const DIMENSION_MAXIMUM_WIDTH = 2048;
/**
* Avatar types mapped to 'd' GET values.
*
* @return array
* An array of GET values keyed by type.
*/
public static function getTypesMap();
/**
* Valid fallback types for when 'gravatar' is the primary type.
*
* @return string[]
* An array of fallback avatar types.
*/
public static function getFallbackTypes();
/**
* Get the fallback avatar type.
*
* @return string|null
* The fallback avatar type, or NULL to use default.
*/
public function getFallbackType();
/**
* The type used for when 'gravatar' type fails.
*
* Such as when there is no Gravatar for the hash.
*
* @param string|null $type
* An avatar type.
*
* @throws \Drupal\avatars\Exception\AvatarException
* Thrown if the passed type is invalid.
*
* @return \Drupal\avatars_gravatar\GravatarInterface
* Returns the called object for chaining.
*/
public function setFallbackType($type = NULL);
/**
* The URI to an image used for when 'gravatar' type fails.
*
* Such as when there is no Gravatar for the hash.
*
* @param string $uri
* The URI of an image to use as a fallback.
*
* @return \Drupal\avatars_gravatar\GravatarInterface
* Returns the called object for chaining.
*/
public function setFallbackUri($uri);
/**
* Get a list of valid ratings.
*
* @return array
* An array of rating labels keyed by rating.
*/
public static function getRatings();
/**
* Get the rating.
*
* @return string|null
* The set rating, or NULL if no rating.
*/
public function getRating();
/**
* Sets the maximum gravatar rating.
*
* @param string|null $rating
* The rating to set, or NULL if no rating.
*
* @throws \Drupal\avatars\Exception\AvatarException
* Thrown if the rating is invalid.
*
* @return \Drupal\avatars_gravatar\GravatarInterface
* Returns the called object for chaining.
*/
public function setRating($rating = NULL);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GravatarInterface:: |
constant | |||
GravatarInterface:: |
constant | |||
GravatarInterface:: |
public | function | Get the fallback avatar type. | 1 |
GravatarInterface:: |
public static | function | Valid fallback types for when 'gravatar' is the primary type. | 1 |
GravatarInterface:: |
public | function | Get the rating. | 1 |
GravatarInterface:: |
public static | function | Get a list of valid ratings. | 1 |
GravatarInterface:: |
public static | function | Avatar types mapped to 'd' GET values. | 1 |
GravatarInterface:: |
constant | |||
GravatarInterface:: |
constant | |||
GravatarInterface:: |
public | function | The type used for when 'gravatar' type fails. | 1 |
GravatarInterface:: |
public | function | The URI to an image used for when 'gravatar' type fails. | 1 |
GravatarInterface:: |
public | function | Sets the maximum gravatar rating. | 1 |