LinkReportClose.php in Open Social 10.0.x
Same filename and directory in other branches
- 8.9 modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 8.5 modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 8.6 modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 8.7 modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 8.8 modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 10.3.x modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 10.1.x modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
- 10.2.x modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.php
File
modules/social_features/social_content_report/src/Plugin/views/field/LinkReportClose.phpView source
<?php
namespace Drupal\social_content_report\Plugin\views\field;
use Drupal\Core\Url;
use Drupal\views\Plugin\views\field\LinkBase;
use Drupal\views\ResultRow;
/**
* Field handler to present a link to close a report.
*
* @ingroup views_field_handlers
*
* @ViewsField("flagging_link_close")
*/
class LinkReportClose extends LinkBase {
/**
* {@inheritdoc}
*/
protected function getUrlInfo(ResultRow $row) {
/** @var \Drupal\flag\FlaggingInterface $flagging */
$flagging = $this
->getEntity($row);
return Url::fromRoute('social_content_report.close_report', [
'flagging' => $flagging
->id(),
]);
}
/**
* {@inheritdoc}
*/
protected function getDefaultLabel() {
return $this
->t('Close');
}
}
Classes
Name | Description |
---|---|
LinkReportClose | Field handler to present a link to close a report. |