You are here

class EntitySuggestion in Linkit 8.5

Defines a entity suggestion.

Hierarchy

Expanded class hierarchy of EntitySuggestion

1 file declares its use of EntitySuggestion
EntityMatcher.php in src/Plugin/Linkit/Matcher/EntityMatcher.php

File

src/Suggestion/EntitySuggestion.php, line 8

Namespace

Drupal\linkit\Suggestion
View source
class EntitySuggestion extends DescriptionSuggestion {

  /**
   * The entity uuid.
   *
   * @var string
   */
  protected $entityUuid;

  /**
   * The entity type id.
   *
   * @var string
   */
  protected $entityTypeId;

  /**
   * The substitution id.
   *
   * @var string
   */
  protected $substitutionId;

  /**
   * Sets the entity uuid.
   *
   * @param string $entity_uuid
   *   The entity uuid.
   *
   * @return $this
   */
  public function setEntityUuid($entity_uuid) {
    $this->entityUuid = $entity_uuid;
    return $this;
  }

  /**
   * Sets the entity type id.
   *
   * @param string $entity_type_id
   *   The entity type id.
   *
   * @return $this
   */
  public function setEntityTypeId($entity_type_id) {
    $this->entityTypeId = $entity_type_id;
    return $this;
  }

  /**
   * Sets the substitution id.
   *
   * @param string $substitution_id
   *   The substitution id.
   *
   * @return $this
   */
  public function setSubstitutionId($substitution_id) {
    $this->substitutionId = $substitution_id;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function jsonSerialize() {
    return parent::jsonSerialize() + [
      'entity_uuid' => $this->entityUuid,
      'entity_type_id' => $this->entityTypeId,
      'substitution_id' => $this->substitutionId,
    ];
  }

}

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::setDescription public function Sets the suggestion description. Overrides SuggestionDescriptionInterface::setDescription
EntitySuggestion::$entityTypeId protected property The entity type id.
EntitySuggestion::$entityUuid protected property The entity uuid.
EntitySuggestion::$substitutionId protected property The substitution id.
EntitySuggestion::jsonSerialize public function Overrides DescriptionSuggestion::jsonSerialize
EntitySuggestion::setEntityTypeId public function Sets the entity type id.
EntitySuggestion::setEntityUuid public function Sets the entity uuid.
EntitySuggestion::setSubstitutionId public function Sets the substitution id.
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