You are here

class Username in Author Pane 8.3

Provides the Username plugin.

Plugin annotation


@AuthorPaneDatum(
  id = "username",
  label = @Translation("Username"),
  description = @Translation("Author's user name"),
  name = "username",
)

Hierarchy

Expanded class hierarchy of Username

File

src/Plugin/AuthorPane/Username.php, line 21
Contains \Drupal\author_pane\Plugin\Username.

Namespace

Drupal\author_pane\Plugin\AuthorPane
View source
class Username extends AuthorDatumBase {
  public function output() {

    // @TODO: Change this to the real output.
    return "Author's name is: " . $this->author
      ->getUsername();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthorDatumBase::$author protected property
AuthorDatumBase::$description protected property A longer explanation of what the plugin is for.
AuthorDatumBase::$id protected property Machine name of the plugin.
AuthorDatumBase::$label protected property Title of the plugin.
AuthorDatumBase::$value protected property The value associated with the plugin in this instance.
AuthorDatumBase::description public function Returns the description of the datum.
AuthorDatumBase::id public function Returns the id of the datum.
AuthorDatumBase::label public function Returns the label of the datum.
AuthorDatumBase::setAuthor public function Sets the author of the datum.
AuthorDatumBase::setValue public function Sets the value of the datum.
AuthorDatumBase::value protected function Returns the value of the datum.
AuthorDatumBase::__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.
Username::output public function Returns the HTML string that contains the output of the datum. Overrides AuthorDatumBase::output