rabbit_hole-8.x-1.x-dev/src/Plugin/RabbitHoleBehaviorPlugin/PageNotFound.php
src/Plugin/RabbitHoleBehaviorPlugin/PageNotFound.php
<?php
namespace Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPlugin;
use Drupal\Core\Entity\EntityInterface;
use Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPluginBase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Denies access to a page.
*
* @RabbitHoleBehaviorPlugin(
* id = "page_not_found",
* label = @Translation("Page not found")
* )
*/
class PageNotFound extends RabbitHoleBehaviorPluginBase {
/**
* {@inheritdoc}
*/
public function performAction(EntityInterface $entity, Response $current_response = NULL) {
throw new NotFoundHttpException();
}
}
