You are here

class DescriptionSuggestion in Linkit 8.5

Defines a linkit suggestion with description.

Hierarchy

Expanded class hierarchy of DescriptionSuggestion

4 files declare their use of DescriptionSuggestion
ConfigurableDummyMatcher.php in tests/linkit_test/src/Plugin/Linkit/Matcher/ConfigurableDummyMatcher.php
EmailMatcher.php in src/Plugin/Linkit/Matcher/EmailMatcher.php
FrontPageMatcher.php in src/Plugin/Linkit/Matcher/FrontPageMatcher.php
SuggestionManager.php in src/SuggestionManager.php

File

src/Suggestion/DescriptionSuggestion.php, line 8

Namespace

Drupal\linkit\Suggestion
View source
class DescriptionSuggestion extends SimpleSuggestion implements SuggestionDescriptionInterface {

  /**
   * The suggestion description.
   *
   * A string with additional information about the suggestion.
   *
   * @var string
   */
  protected $description;

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this->description;
  }

  /**
   * {@inheritdoc}
   */
  public function setDescription($description) {
    $this->description = $description;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function jsonSerialize() {
    return parent::jsonSerialize() + [
      'description' => $this
        ->getDescription(),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DescriptionSuggestion::$description protected property The suggestion description.
DescriptionSuggestion::getDescription public function Gets the suggestion description. Overrides SuggestionDescriptionInterface::getDescription
DescriptionSuggestion::jsonSerialize public function Overrides SimpleSuggestion::jsonSerialize 1
DescriptionSuggestion::setDescription public function Sets the suggestion description. Overrides SuggestionDescriptionInterface::setDescription
SimpleSuggestion::$group protected property The suggestion group.
SimpleSuggestion::$label protected property The suggestion label.
SimpleSuggestion::$path protected property The suggestion path.
SimpleSuggestion::getGroup public function Gets the suggestion group. Overrides SuggestionInterface::getGroup
SimpleSuggestion::getLabel public function Gets the suggestion label. Overrides SuggestionInterface::getLabel
SimpleSuggestion::getPath public function Gets the suggestion path. Overrides SuggestionInterface::getPath
SimpleSuggestion::setGroup public function Sets the suggestion group. Overrides SuggestionInterface::setGroup
SimpleSuggestion::setLabel public function Sets the suggestion label. Overrides SuggestionInterface::setLabel
SimpleSuggestion::setPath public function Sets the suggestion path. Overrides SuggestionInterface::setPath