You are here

protected function DefaultHtmlRouteProvider::getAddFormRoute in farmOS 2.x

File

modules/core/entity/src/Routing/DefaultHtmlRouteProvider.php, line 20

Class

DefaultHtmlRouteProvider
Deny access to the entity type add form.

Namespace

Drupal\farm_entity\Routing

Code

protected function getAddFormRoute(EntityTypeInterface $entity_type) {
  $route = parent::getAddFormRoute($entity_type);
  if (!empty($route)) {
    $route
      ->setRequirement('_access', 'FALSE');
  }
  return $route;
}