function public function ThemeSuggestions::getEntity

8 ThemeSuggestions.php public ThemeSuggestions::getEntity(Variables $variables, $entity_type = 'entity')

Extracts the entity from the element(s) passed in the Variables object.

Parameters

\Drupal\bootstrap\Utility\Variables $variables: The Variables object, this is ignored.

string $entity_type: Optional. The entity type to attempt to retrieve.

Return value

\Drupal\Core\Entity\EntityInterface|null The extracted entity, NULL if entity could not be found.

Deprecated

Since 8.x-3.2. Will be removed in a future release.

Class

ThemeSuggestions
Implements hook_theme_suggestions_alter().

Namespace

Drupal\bootstrap\Plugin\Alter

Source src/Plugin/Alter/ThemeSuggestions.php (line 354)

public function getEntity(Variables $variables, $entity_type = 'entity') {
  Bootstrap::deprecated();
  return $this->getEntityObject($entity_type);
}