You are here

class Adorable in Avatar Kit 8

Same name in this branch
  1. 8 avatars_adorable/src/Adorable.php \Drupal\avatars_adorable\Adorable
  2. 8 avatars_adorable/src/Plugin/AvatarGenerator/Adorable.php \Drupal\avatars_adorable\Plugin\AvatarGenerator\Adorable

Adorable.io avatar generator.

Plugin annotation


@AvatarGenerator(
  id = "adorable",
  label = @Translation("Adorable"),
  description = @Translation("Adorable avatars by adorable.io"),
  fallback = TRUE,
  dynamic = FALSE,
  remote = TRUE
)

Hierarchy

Expanded class hierarchy of Adorable

1 string reference to 'Adorable'
avatars_adorable.info.yml in avatars_adorable/avatars_adorable.info.yml
avatars_adorable/avatars_adorable.info.yml

File

avatars_adorable/src/Plugin/AvatarGenerator/Adorable.php, line 21

Namespace

Drupal\avatars_adorable\Plugin\AvatarGenerator
View source
class Adorable extends AvatarGeneratorBase {

  /**
   * {@inheritdoc}
   */
  public function generateUri(AccountInterface $account) {
    $api = new AdorableAPI();
    return $api
      ->setIdentifier($this
      ->getIdentifier($account))
      ->setDimensions(256)
      ->getUrl();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Adorable::generateUri public function Creates a URI to an avatar. Overrides AvatarGeneratorBase::generateUri
AvatarGeneratorBase::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm 3
AvatarGeneratorBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies
AvatarGeneratorBase::defaultConfiguration public function Gets default configuration for this plugin. Overrides ConfigurableInterface::defaultConfiguration 3
AvatarGeneratorBase::getConfiguration public function Gets this plugin's configuration. Overrides ConfigurableInterface::getConfiguration
AvatarGeneratorBase::getFile public function Gets File object for an avatar. Overrides AvatarGeneratorPluginInterface::getFile 1
AvatarGeneratorBase::getIdentifier protected function Create a site-unique identifier for a user.
AvatarGeneratorBase::setConfiguration public function Sets the configuration for this plugin instance. Overrides ConfigurableInterface::setConfiguration
AvatarGeneratorBase::settingsSummary public function Generate a summary about the current configuration of the widget. Overrides AvatarGeneratorPluginInterface::settingsSummary 3
AvatarGeneratorBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm 3
AvatarGeneratorBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm
AvatarGeneratorBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.