You are here

public function WebformRequest::hasSourceEntityWebformRoutes in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformRequest.php \Drupal\webform\WebformRequest::hasSourceEntityWebformRoutes()

Check if a source entity has dedicate webform routes.

Parameters

\Drupal\Core\Entity\EntityInterface|null $source_entity: A webform submission's source entity.

Return value

bool TRUE if a source entity has dedicate webform routes.

Overrides WebformRequestInterface::hasSourceEntityWebformRoutes

2 calls to WebformRequest::hasSourceEntityWebformRoutes()
WebformRequest::getRouteName in src/WebformRequest.php
Get the route name for a form/submission and source entity.
WebformRequest::getRouteParameters in src/WebformRequest.php
Get the route parameters for a form/submission and source entity.

File

src/WebformRequest.php, line 305

Class

WebformRequest
Handles webform requests.

Namespace

Drupal\webform

Code

public function hasSourceEntityWebformRoutes(EntityInterface $source_entity = NULL) {
  if ($source_entity && $this
    ->routeExists('entity.' . $source_entity
    ->getEntityTypeId() . '.webform_submission.canonical')) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}