You are here

protected function BrightcoveVideoHtmlRouteProvider::getSettingsFormRoute in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/BrightcoveVideoHtmlRouteProvider.php \Drupal\brightcove\BrightcoveVideoHtmlRouteProvider::getSettingsFormRoute()
  2. 3.x src/BrightcoveVideoHtmlRouteProvider.php \Drupal\brightcove\BrightcoveVideoHtmlRouteProvider::getSettingsFormRoute()
1 call to BrightcoveVideoHtmlRouteProvider::getSettingsFormRoute()
BrightcoveVideoHtmlRouteProvider::getRoutes in src/BrightcoveVideoHtmlRouteProvider.php
Provides routes for entities.

File

src/BrightcoveVideoHtmlRouteProvider.php, line 95

Class

BrightcoveVideoHtmlRouteProvider
Provides routes for Brightcove Videos.

Namespace

Drupal\brightcove

Code

protected function getSettingsFormRoute(EntityTypeInterface $entity_type) {
  if (!$entity_type
    ->getBundleEntityType()) {
    $route = new Route("/admin/structure/{$entity_type->id()}/settings");
    $route
      ->setDefaults([
      '_form' => 'Drupal\\brightcove\\Form\\BrightcoveVideoSettingsForm',
      '_title' => "{$entity_type->getLabel()} settings",
    ])
      ->setRequirement('_permission', $entity_type
      ->getAdminPermission())
      ->setOption('_admin_route', TRUE);
    return $route;
  }
  return NULL;
}