You are here

public function FormsStepsManager::getFormsStepsByRoute in Forms Steps 8

Get the forms_steps entity by route.

Parameters

mixed $route_name: Current route.

Return value

null|FormsSteps Returns the Forms Steps of the route.

1 call to FormsStepsManager::getFormsStepsByRoute()
FormsStepsManager::getStepByRoute in src/Service/FormsStepsManager.php
Get the forms_steps step by route.

File

src/Service/FormsStepsManager.php, line 163

Class

FormsStepsManager
Class FormsStepsManager.

Namespace

Drupal\forms_steps\Service

Code

public function getFormsStepsByRoute($route_name) {
  $matches = self::getRouteParameters($route_name);
  if ($matches) {

    /** @var \Drupal\forms_steps\Entity\FormsSteps $formsSteps */
    $formsSteps = FormsSteps::load($matches[1]);
    if (!$formsSteps) {
      return NULL;
    }
    return $formsSteps;
  }
  return NULL;
}