You are here

public function FeaturesBundle::getShortName in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/Entity/FeaturesBundle.php \Drupal\features\Entity\FeaturesBundle::getShortName()

Returns a short machine name not prefixed with the bundle name.

Parameters

string $machine_name: The full machine_name of a bundle.

Return value

string The short machine_name of a bundle.

Overrides FeaturesBundleInterface::getShortName

File

src/Entity/FeaturesBundle.php, line 143

Class

FeaturesBundle
Defines a features bundle.

Namespace

Drupal\features\Entity

Code

public function getShortName($machine_name) {
  if (!$this
    ->isProfilePackage($machine_name) && $this
    ->inBundle($machine_name)) {
    return substr($machine_name, strlen($this
      ->getMachineName()) + 1, strlen($machine_name) - strlen($this
      ->getMachineName()) - 1);
  }
  return $machine_name;
}