You are here

class SimpleSuggestion in Linkit 8.5

Defines a simple suggestion.

Hierarchy

Expanded class hierarchy of SimpleSuggestion

1 file declares its use of SimpleSuggestion
DummyMatcher.php in tests/linkit_test/src/Plugin/Linkit/Matcher/DummyMatcher.php

File

src/Suggestion/SimpleSuggestion.php, line 8

Namespace

Drupal\linkit\Suggestion
View source
class SimpleSuggestion implements SuggestionInterface {

  /**
   * The suggestion label.
   *
   * @var string
   */
  protected $label;

  /**
   * The suggestion path.
   *
   * @var string
   */
  protected $path;

  /**
   * The suggestion group.
   *
   * @var string
   */
  protected $group;

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

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

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

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

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

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

  /**
   * {@inheritdoc}
   */
  public function jsonSerialize() {
    return [
      'label' => $this
        ->getLabel(),
      'path' => $this
        ->getPath(),
      'group' => $this
        ->getGroup(),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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::jsonSerialize public function 1
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