You are here

protected function CorrespondingReferenceForm::getFieldOptions in Corresponding Entity References 8.4

Gets an array of field options to populate in the form.

Return value

array An array of field options.

1 call to CorrespondingReferenceForm::getFieldOptions()
CorrespondingReferenceForm::form in src/Form/CorrespondingReferenceForm.php
Gets the actual form array to be built.

File

src/Form/CorrespondingReferenceForm.php, line 169

Class

CorrespondingReferenceForm
Form handler for corresponding reference add and edit forms.

Namespace

Drupal\cer\Form

Code

protected function getFieldOptions() {
  $options = [];
  foreach ($this
    ->getReferenceFieldMap() as $entityType => $entityTypeFields) {
    foreach ($entityTypeFields as $fieldName => $field) {
      if (!preg_match('/^field_.*$/', $fieldName)) {
        continue;
      }
      $options[$fieldName] = $fieldName;
    }
  }
  return $options;
}