function EntityResourcePostRouteSubscriber::getSubscribedEvents

Same name in other branches
  1. 9 core/modules/rest/src/EventSubscriber/EntityResourcePostRouteSubscriber.php \Drupal\rest\EventSubscriber\EntityResourcePostRouteSubscriber::getSubscribedEvents()
  2. 8.9.x core/modules/rest/src/EventSubscriber/EntityResourcePostRouteSubscriber.php \Drupal\rest\EventSubscriber\EntityResourcePostRouteSubscriber::getSubscribedEvents()
  3. 10 core/modules/rest/src/EventSubscriber/EntityResourcePostRouteSubscriber.php \Drupal\rest\EventSubscriber\EntityResourcePostRouteSubscriber::getSubscribedEvents()

File

core/modules/rest/src/EventSubscriber/EntityResourcePostRouteSubscriber.php, line 67

Class

EntityResourcePostRouteSubscriber
Generates a 'create' route for an entity type if it has a REST POST route.

Namespace

Drupal\rest\EventSubscriber

Code

public static function getSubscribedEvents() : array {
    // Priority -10, to run after \Drupal\rest\Routing\ResourceRoutes, which has
    // priority 0.
    $events[RoutingEvents::DYNAMIC][] = [
        'onDynamicRouteEvent',
        -10,
    ];
    return $events;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.