You are here

protected function MappingSteps::filterFields in GatherContent 8.4

Same name and namespace in other branches
  1. 8.5 gathercontent_ui/src/Form/MappingEditSteps/MappingSteps.php \Drupal\gathercontent_ui\Form\MappingEditSteps\MappingSteps::filterFields()

Wrapper function for filterFieldsRecursively.

Use for filtering only equivalent fields.

Parameters

\Cheppers\GatherContent\DataTypes\Element $gc_field: Type of field in GatherContent.

string $content_type: Name of Drupal content type.

Return value

array Associative array with equivalent fields.

2 calls to MappingSteps::filterFields()
MappingStepEdit::getForm in gathercontent_ui/src/Form/MappingEditSteps/MappingStepEdit.php
Returns form array.
MappingStepNew::getForm in gathercontent_ui/src/Form/MappingEditSteps/MappingStepNew.php
Returns form array.

File

gathercontent_ui/src/Form/MappingEditSteps/MappingSteps.php, line 293

Class

MappingSteps
Class MappingSteps.

Namespace

Drupal\gathercontent_ui\Form\MappingEditSteps

Code

protected function filterFields(Element $gc_field, $content_type) {
  $fields = $this
    ->filterFieldsRecursively($gc_field, $content_type);
  if ($gc_field->type === 'text' && $gc_field instanceof ElementText && $gc_field->plainText) {
    $fields['title'] = 'Title';
  }
  return $fields;
}