arch-8.x-1.x-dev/modules/price/src/Entity/Routing/PriceTypeRouteProvider.php

modules/price/src/Entity/Routing/PriceTypeRouteProvider.php
<?php

namespace Drupal\arch_price\Entity\Routing;

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;

/**
 * Price type route provider.
 *
 * @package Drupal\arch_price\Entity\Routing
 */
class PriceTypeRouteProvider extends AdminHtmlRouteProvider {

  /**
   * {@inheritdoc}
   */
  public function getRoutes(EntityTypeInterface $entity_type) {
    $collection = parent::getRoutes($entity_type);
    return $collection;
  }

  /**
   * {@inheritdoc}
   */
  protected function getCollectionRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getCollectionRoute($entity_type)) {
      $route->setRequirement('_permission', 'access price type overview+administer prices');
      return $route;
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc