3 namespace Drupal\comment\Plugin\views\field;
6 use Drupal\views\Plugin\views\field\LinkBase;
7 use Drupal\views\ResultRow;
10 * Provides a comment approve link.
12 * @ingroup views_field_handlers
14 * @ViewsField("comment_link_approve")
16 class LinkApprove extends LinkBase {
21 protected function getUrlInfo(ResultRow $row) {
22 return Url::fromRoute('comment.approve', ['comment' => $this->getEntity($row)->id()]);
28 protected function renderLink(ResultRow $row) {
29 $this->options['alter']['query'] = $this->getDestinationArray();
30 return parent::renderLink($row);
36 protected function getDefaultLabel() {
37 return $this->t('Approve');