BcRoute.php 730 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\Core\Routing;
  3. use Symfony\Component\Routing\Route;
  4. /**
  5. * A backwards compatibility route.
  6. *
  7. * When a route is deprecated for another one, and backwards compatibility is
  8. * provided, then it's best practice to:
  9. * - not duplicate all route definition metadata, to instead have an "as empty
  10. * as possible" route
  11. * - have an accompanying outbound route processor, that overwrites this empty
  12. * route definition with the redirected route's definition.
  13. *
  14. * @see \Drupal\rest\RouteProcessor\RestResourceGetRouteProcessorBC
  15. */
  16. class BcRoute extends Route {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function __construct() {
  21. parent::__construct('');
  22. $this->setOption('bc_route', TRUE);
  23. }
  24. }