You are here

protected function ExtraFieldTypePluginBase::getTargetEntityTypeBundle in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/ExtraFieldTypePluginBase.php \Drupal\entity_extra_field\ExtraFieldTypePluginBase::getTargetEntityTypeBundle()

Get target entity type bundle.

Return value

\Drupal\Core\Entity\EntityTypeInterface|bool The target entity type bundle; otherwise FALSE.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/ExtraFieldTypePluginBase.php, line 226

Class

ExtraFieldTypePluginBase
Define extra field type plugin base.

Namespace

Drupal\entity_extra_field

Code

protected function getTargetEntityTypeBundle() {
  $entity_type_id = $this
    ->getTargetEntityTypeId();
  $bundle_entity_type = $bundle_entity_type = $this->entityTypeManager
    ->getDefinition($entity_type_id)
    ->getBundleEntityType();
  if (!isset($bundle_entity_type)) {
    return FALSE;
  }
  return $this->currentRouteMatch
    ->getParameter($bundle_entity_type) ?: FALSE;
}