You are here

protected function LinkReply::getUrlInfo in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/views/field/LinkReply.php \Drupal\comment\Plugin\views\field\LinkReply::getUrlInfo()
  2. 9 core/modules/comment/src/Plugin/views/field/LinkReply.php \Drupal\comment\Plugin\views\field\LinkReply::getUrlInfo()

Returns the URI elements of the link.

Parameters

\Drupal\views\ResultRow $row: A view result row.

Return value

\Drupal\Core\Url The URI elements of the link.

Overrides LinkBase::getUrlInfo

File

core/modules/comment/src/Plugin/views/field/LinkReply.php, line 21

Class

LinkReply
Field handler to present a link to reply to a comment.

Namespace

Drupal\comment\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {

  /** @var \Drupal\comment\CommentInterface $comment */
  $comment = $this
    ->getEntity($row);
  return Url::fromRoute('comment.reply', [
    'entity_type' => $comment
      ->getCommentedEntityTypeId(),
    'entity' => $comment
      ->getCommentedEntityId(),
    'field_name' => $comment
      ->getFieldName(),
    'pid' => $comment
      ->id(),
  ]);
}