You are here

protected function ContentEntityCdfNormalizer::removeBracketsUuid in Acquia Content Hub 8

Remove brackets from the Uuid.

Parameters

string $uuid_with_brakets: A [UUID] enclosed within brackets.

Return value

mixed The UUID without brackets, FALSE otherwise.

1 call to ContentEntityCdfNormalizer::removeBracketsUuid()
ContentEntityCdfNormalizer::addFieldsToDrupalEntity in src/Normalizer/ContentEntityCdfNormalizer.php
Adds Content Hub Data to Drupal Entity Fields.

File

src/Normalizer/ContentEntityCdfNormalizer.php, line 1460

Class

ContentEntityCdfNormalizer
Converts the Drupal entity object to a Acquia Content Hub CDF array.

Namespace

Drupal\acquia_contenthub\Normalizer

Code

protected function removeBracketsUuid($uuid_with_brakets) {
  preg_match('#\\[(.*)\\]#', $uuid_with_brakets, $match);
  $uuid = isset($match[1]) ? $match[1] : '';
  if (Uuid::isValid($uuid)) {
    return $uuid;
  }
  else {
    return FALSE;
  }
}