You are here

protected function FlexiformController::getProvidedEntities in Flexiform 8

Get the provided entities.

Return value

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

2 calls to FlexiformController::getProvidedEntities()
FlexiformController::formModePage in src/Controller/FlexiformController.php
Flexiform form mode page.
FlexiformController::formModePageTitle in src/Controller/FlexiformController.php
Flexiform form mode title callback.

File

src/Controller/FlexiformController.php, line 117

Class

FlexiformController
Controller for flexiform pages.

Namespace

Drupal\flexiform\Controller

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;
}