You are here

public function AppDeleteForm::getEntityFromRouteMatch in Apigee Edge 8

Determines which entity will be used by this form from a RouteMatch object.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

string $entity_type_id: The entity type identifier.

Return value

\Drupal\Core\Entity\EntityInterface The entity object as determined from the passed-in route match.

Overrides EntityForm::getEntityFromRouteMatch

File

src/Entity/Form/AppDeleteForm.php, line 53

Class

AppDeleteForm
General form handler for developer/team (company) app delete forms.

Namespace

Drupal\apigee_edge\Entity\Form

Code

public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entity_type_id) {

  // Always expect that the parameter in the route is not the entity type
  // (ex: {developer_app}) in case of apps rather just {app}.
  if ($route_match
    ->getRawParameter('app') !== NULL) {
    $entity = $route_match
      ->getParameter('app');
  }
  else {
    $entity = parent::getEntityFromRouteMatch($route_match, $entity_type_id);
  }
  return $entity;
}