You are here

protected function ConfigEntityHandler::removeChannelId in Acquia Content Hub 8.2

Remove channel id.

Parameters

string $langcode: Language code.

Return value

string|string[]|null Langcode without id.

1 call to ConfigEntityHandler::removeChannelId()
ConfigEntityHandler::onParseCdf in src/EventSubscriber/Cdf/ConfigEntityHandler.php
Parses the CDF representation of Configuration Entities.

File

src/EventSubscriber/Cdf/ConfigEntityHandler.php, line 203

Class

ConfigEntityHandler
The Configuration entity CDF creator.

Namespace

Drupal\acquia_contenthub\EventSubscriber\Cdf

Code

protected function removeChannelId(string $langcode) {
  $pattern = '/(\\w+)_(\\d+)/i';
  $replacement = '${1}';
  return preg_replace($pattern, $replacement, $langcode);
}