You are here

protected function CorrespondingReferenceForm::getBundleValuesForEntity in Corresponding Entity References 8.4

Gets bundle options value in a format for use in the config entity.

Parameters

array|NULL $values: The values to convert.

Return value

array The converted values.

1 call to CorrespondingReferenceForm::getBundleValuesForEntity()
CorrespondingReferenceForm::copyFormValuesToEntity in src/Form/CorrespondingReferenceForm.php
Copies form values into the config entity.

File

src/Form/CorrespondingReferenceForm.php, line 260

Class

CorrespondingReferenceForm
Form handler for corresponding reference add and edit forms.

Namespace

Drupal\cer\Form

Code

protected function getBundleValuesForEntity(array $values = NULL) {
  $entityValues = [];
  if (!is_null($values)) {
    foreach ($values as $value) {
      list($entityType, $bundle) = explode(':', $value);
      $entityValues[$entityType][] = $bundle;
    }
  }
  return $entityValues;
}