public function SimpleEntityFormModes::getEntityFromRouteMatch in Form mode manager 8.2
Return value
\Drupal\Core\Entity\EntityInterface A new entity object build with given route_match.
Overrides AbstractEntityFormModesFactory::getEntityFromRouteMatch
2 calls to SimpleEntityFormModes::getEntityFromRouteMatch()
- SimpleEntityFormModes::checkAccess in src/
SimpleEntityFormModes.php - Checks access for the Form Mode Manager routes.
- SimpleEntityFormModes::getEntity in src/
SimpleEntityFormModes.php
File
- src/
SimpleEntityFormModes.php, line 93
Class
- SimpleEntityFormModes
- Route controller factory specific for each entities not using bundles.
Namespace
Drupal\form_mode_managerCode
public function getEntityFromRouteMatch(RouteMatchInterface $route_match) {
$entity_type_id = $route_match
->getRouteObject()
->getOption('_form_mode_manager_entity_type_id');
$entity = $route_match
->getParameter($entity_type_id);
return $entity;
}