class User in Avatar Kit 8
User plugin.
Plugin annotation
@AvatarGenerator(
id = "user",
label = @Translation("User upload"),
description = @Translation("Image uploaded by the user to the site."),
dynamic = TRUE,
fallback = FALSE,
remote = FALSE
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\avatars\Plugin\AvatarGenerator\AvatarGeneratorBase implements AvatarGeneratorPluginInterface
- class \Drupal\avatars\Plugin\AvatarGenerator\User
- class \Drupal\avatars\Plugin\AvatarGenerator\AvatarGeneratorBase implements AvatarGeneratorPluginInterface
Expanded class hierarchy of User
File
- src/
Plugin/ AvatarGenerator/ User.php, line 20
Namespace
Drupal\avatars\Plugin\AvatarGeneratorView source
class User extends AvatarGeneratorBase {
/**
* {@inheritdoc}
*/
public function getFile(AccountInterface $account) {
if (!$account
->isAnonymous() && ($user = CoreUser::load($account
->id()))) {
$entities = $user->{AK_FIELD_PICTURE_USER}
->referencedEntities();
return reset($entities);
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AvatarGeneratorBase:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
3 |
AvatarGeneratorBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
AvatarGeneratorBase:: |
public | function |
Gets default configuration for this plugin. Overrides ConfigurableInterface:: |
3 |
AvatarGeneratorBase:: |
public | function |
Creates a URI to an avatar. Overrides AvatarGeneratorPluginInterface:: |
8 |
AvatarGeneratorBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
AvatarGeneratorBase:: |
protected | function | Create a site-unique identifier for a user. | |
AvatarGeneratorBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
AvatarGeneratorBase:: |
public | function |
Generate a summary about the current configuration of the widget. Overrides AvatarGeneratorPluginInterface:: |
3 |
AvatarGeneratorBase:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
3 |
AvatarGeneratorBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
AvatarGeneratorBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
User:: |
public | function |
Gets File object for an avatar. Overrides AvatarGeneratorBase:: |