You are here

protected function EntityExtraField::getBaseEntityBundleUiPath in Entity Extra Field 8

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

Get base entity bundle UI path.

Return value

bool|string|null

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to EntityExtraField::getBaseEntityBundleUiPath()
EntityExtraField::linkTemplates in src/Entity/EntityExtraField.php
Gets an array link templates.

File

src/Entity/EntityExtraField.php, line 447

Class

EntityExtraField
Define entity extra field.

Namespace

Drupal\entity_extra_field\Entity

Code

protected function getBaseEntityBundleUiPath() {
  $base_route = $this
    ->getBaseEntityType()
    ->get('field_ui_base_route');
  if (!isset($base_route)) {
    return NULL;
  }
  $base_route_rel = strtr(substr($base_route, strrpos($base_route, '.') + 1), [
    '_' => '-',
  ]);
  $base_entity_bundle = $this
    ->getBaseEntityTypeBundle();
  if (!$base_entity_bundle
    ->hasLinkTemplate($base_route_rel)) {
    return NULL;
  }
  return $base_entity_bundle
    ->getLinkTemplate($base_route_rel);
}