function LinkApprove::getUrlInfo

Same name in other branches
  1. 9 core/modules/comment/src/Plugin/views/field/LinkApprove.php \Drupal\comment\Plugin\views\field\LinkApprove::getUrlInfo()
  2. 8.9.x core/modules/comment/src/Plugin/views/field/LinkApprove.php \Drupal\comment\Plugin\views\field\LinkApprove::getUrlInfo()
  3. 10 core/modules/comment/src/Plugin/views/field/LinkApprove.php \Drupal\comment\Plugin\views\field\LinkApprove::getUrlInfo()

Overrides LinkBase::getUrlInfo

File

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

Class

LinkApprove
Provides a comment approve link.

Namespace

Drupal\comment\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {
    $entity = $this->getEntity($row);
    if (!$entity) {
        return NULL;
    }
    return Url::fromRoute('comment.approve', [
        'comment' => $entity->id(),
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.