hasRequirement('_entity_bundles')) { list($entity_type, $bundle_definition) = explode(':', $route->getRequirement('_entity_bundles')); $bundles = explode('|', $bundle_definition); $parameters = $route_match->getParameters(); if ($parameters->has($entity_type)) { $entity = $parameters->get($entity_type); if ($entity instanceof EntityInterface && in_array($entity->bundle(), $bundles, TRUE)) { return AccessResult::allowed()->addCacheableDependency($entity); } } } return AccessResult::neutral('The entity bundle does not match the route _entity_bundles requirement.'); } }