You are here

public function ThemeSuggestions::getEntity in Express 8

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.

See also

\Drupal\bootstrap\Plugin\Alter\ThemeSuggestions::getEntityObject

File

themes/contrib/bootstrap/src/Plugin/Alter/ThemeSuggestions.php, line 364
Contains \Drupal\bootstrap\Plugin\Alter\ThemeSuggestions.

Class

ThemeSuggestions
Implements hook_theme_suggestions_alter().

Namespace

Drupal\bootstrap\Plugin\Alter

Code

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