You are here

protected function FormModePageAccessCheck::getProvidedEntities in Flexiform 8

Get the provided entities.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of provided entities keyed by machine name.

1 call to FormModePageAccessCheck::getProvidedEntities()
FormModePageAccessCheck::access in src/Access/FormModePageAccessCheck.php
Flexiform form mode access callback.

File

src/Access/FormModePageAccessCheck.php, line 40

Class

FormModePageAccessCheck
Checks access for displaying configuration translation page.

Namespace

Drupal\flexiform\Access

Code

protected function getProvidedEntities(EntityFormMode $form_mode, Request $request) {
  $route_match = RouteMatch::createFromRequest($request);
  $settings = $form_mode
    ->getThirdPartySetting('flexiform', 'exposure');
  $provided = [];
  $provided['base_entity'] = $route_match
    ->getParameter('base_entity');
  foreach ($settings['parameters'] as $namespace => $info) {
    if ($provided_entity = $route_match
      ->getParameter($namespace)) {
      $provided[$namespace] = $provided_entity;
    }
  }
  return $provided;
}