ReportController.php in Open Social 8.6
Same filename and directory in other branches
- 8.9 modules/social_features/social_content_report/src/Controller/ReportController.php
- 8.5 modules/social_features/social_content_report/src/Controller/ReportController.php
- 8.7 modules/social_features/social_content_report/src/Controller/ReportController.php
- 8.8 modules/social_features/social_content_report/src/Controller/ReportController.php
- 10.3.x modules/social_features/social_content_report/src/Controller/ReportController.php
- 10.0.x modules/social_features/social_content_report/src/Controller/ReportController.php
- 10.1.x modules/social_features/social_content_report/src/Controller/ReportController.php
- 10.2.x modules/social_features/social_content_report/src/Controller/ReportController.php
Namespace
Drupal\social_content_report\ControllerFile
modules/social_features/social_content_report/src/Controller/ReportController.phpView source
<?php
namespace Drupal\social_content_report\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\flag\FlaggingInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* Class ReportController.
*
* @package Drupal\social_content_report\Controller
*/
class ReportController extends ControllerBase {
/**
* Function for suggestions.
*
* @param \Drupal\flag\FlaggingInterface $flagging
* The Flagging object to close.
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* A simple response.
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
public function close(FlaggingInterface $flagging) {
if ($flagging
->hasField('field_status')) {
// Disable the status field.
$flagging
->set('field_status', 0);
$flagging
->save();
}
return new RedirectResponse('view.report_overview.overview');
}
}
Classes
Name | Description |
---|---|
ReportController | Class ReportController. |