You are here

class Fruit in Plug 7

Hierarchy

Expanded class hierarchy of Fruit

File

modules/plug_example/src/Plugin/fruit/Fruit.php, line 12
Contains Drupal\plug_example\Plugin\fruit\Fruit

Namespace

Drupal\plug_example\Plugin\fruit
View source
class Fruit extends PluginBase implements FruitInterface {

  /**
   * {@inheritdoc}
   */
  public function display() {
    $definition = $this
      ->getPluginDefinition();
    if (!empty($definition['slimy'])) {
      return t('Yikes, %name!', array(
        '%name' => $definition['label'],
      ));
    }
    return t('Fruit name: %name', array(
      '%name' => $definition['label'],
    ));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Fruit::display public function Displays a fruit. Overrides FruitInterface::display
PluginBase::$configuration protected property Configuration information passed into the plugin.
PluginBase::$pluginDefinition protected property The plugin implementation definition.
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
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::__construct public function Constructs a Drupal\Component\Plugin\PluginBase object. 1