You are here

public function ExampleMeatballSandwich::description in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php \Drupal\plugin_type_example\Plugin\Sandwich\ExampleMeatballSandwich::description()

Provide a description of the sandwich.

Return value

string A string description of the sandwich.

Overrides SandwichBase::description

File

plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php, line 97

Class

ExampleMeatballSandwich
Provides a meatball sandwich.

Namespace

Drupal\plugin_type_example\Plugin\Sandwich

Code

public function description() {

  // We override the description() method in order to change the description
  // text based on the date. On Sunday we only have day old bread.
  if ($this->day == 'Sun') {
    return $this
      ->t("Italian style meatballs drenched in irresistible marinara sauce, served on day old bread.");
  }
  return parent::description();
}