public function ReportController::close in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 8.5 modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 8.6 modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 8.7 modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 8.8 modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 10.3.x modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 10.0.x modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
- 10.2.x modules/social_features/social_content_report/src/Controller/ReportController.php \Drupal\social_content_report\Controller\ReportController::close()
Function for suggestions.
Parameters
\Drupal\flag\FlaggingInterface $flagging: The Flagging object to close.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse A simple response.
Throws
\Drupal\Core\Entity\EntityStorageException
1 string reference to 'ReportController::close'
- social_content_report.routing.yml in modules/
social_features/ social_content_report/ social_content_report.routing.yml - modules/social_features/social_content_report/social_content_report.routing.yml
File
- modules/
social_features/ social_content_report/ src/ Controller/ ReportController.php, line 27
Class
- ReportController
- Class ReportController.
Namespace
Drupal\social_content_report\ControllerCode
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');
}