You are here

public static function QueryStringWebformSourceEntity::getRouteOptionsQuery in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformSourceEntity/QueryStringWebformSourceEntity.php \Drupal\webform\Plugin\WebformSourceEntity\QueryStringWebformSourceEntity::getRouteOptionsQuery()

Get source entity route options query string parameters.

Parameters

\Drupal\Core\Entity\EntityInterface|null $entity: An entity.

Return value

array An associative array contains a source entity's route options query string parameters.

4 calls to QueryStringWebformSourceEntity::getRouteOptionsQuery()
WebformEntityReferenceLinkFormatter::viewElements in src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php
Builds a renderable array for a field value.
WebformEntityReferenceUrlFormatter::viewElements in src/Plugin/Field/FieldFormatter/WebformEntityReferenceUrlFormatter.php
Builds a renderable array for a field value.
WebformShareIframe::preRenderWebformShareIframe in modules/webform_share/src/Element/WebformShareIframe.php
Webform share iframe element pre render callback.
WebformShareScript::preRenderWebformShareScript in modules/webform_share/src/Element/WebformShareScript.php
Webform share iframe element pre render callback.

File

src/Plugin/WebformSourceEntity/QueryStringWebformSourceEntity.php, line 178

Class

QueryStringWebformSourceEntity
Detect source entity by examining query string.

Namespace

Drupal\webform\Plugin\WebformSourceEntity

Code

public static function getRouteOptionsQuery(EntityInterface $entity = NULL) {
  if (!$entity) {
    return [];
  }
  else {
    return [
      'query' => [
        'source_entity_type' => $entity
          ->getEntityTypeId(),
        'source_entity_id' => $entity
          ->id(),
      ],
    ];
  }
}