You are here

function redhen_connection_get_connection_entity_from_route in RedHen CRM 8

Extracts the entity for the current redhen_connection route.

Return value

null|\Drupal\Core\Entity\EntityInterface Entity type id.

5 calls to redhen_connection_get_connection_entity_from_route()
ConnectionAddController::add in modules/redhen_connection/src/Controller/ConnectionAddController.php
Displays add links for available bundles/types for redhen_connection.
ConnectionAddController::addForm in modules/redhen_connection/src/Controller/ConnectionAddController.php
Creation form for redhen_connection entities of given bundle/type.
ConnectionAddController::getAddFormTitle in modules/redhen_connection/src/Controller/ConnectionAddController.php
Provides the page title for this controller.
RedhenConnections::access in modules/redhen_connection/src/Controller/RedhenConnections.php
Checks access for a specific request.
RedhenConnections::list in modules/redhen_connection/src/Controller/RedhenConnections.php
Displays add links for available bundles/types for redhen_connection.

File

modules/redhen_connection/redhen_connection.module, line 184
Contains redhen_connection.module..

Code

function redhen_connection_get_connection_entity_from_route() {
  foreach (\Drupal::routeMatch()
    ->getParameters() as $param) {
    if ($param instanceof EntityInterface) {
      if ($param
        ->getEntityTypeId() !== 'redhen_connection_type') {
        return $param;
      }
    }
  }
  return NULL;
}