function gc_gc_process_content_pane in GatherContent 8.3
Same name and namespace in other branches
- 8 gathercontent.module \gc_gc_process_content_pane()
Processing function for content panes.
Parameters
\Drupal\node\NodeInterface $entity: Object of node.
string $local_field_name: Name of local Drupal field.
object $field: Object of GatherContent field.
bool $is_translatable: Indicator if node is translatable.
string $language: Language of translation if applicable.
array $files: Array of files fetched from GatherContent.
1 call to gc_gc_process_content_pane()
- _gc_fetcher in ./
gathercontent.module - Function for fetching, creating and updating content from GatherContent.
File
- ./
gathercontent.module, line 345 - Main module file for GatherContent module.
Code
function gc_gc_process_content_pane(NodeInterface &$entity, $local_field_name, $field, $is_translatable, $language, array $files) {
$field_info = FieldConfig::loadByName('node', $entity
->bundle(), $local_field_name);
if (!is_null($field_info)) {
$is_translatable = $is_translatable && $field_info
->isTranslatable();
}
switch ($field->type) {
case 'files':
gc_gc_process_files_field($entity, $local_field_name, $field->name, $is_translatable, $language, $files);
break;
case 'choice_radio':
gc_gc_process_choice_radio_field($entity, $local_field_name, $is_translatable, $language, $field->options);
break;
case 'choice_checkbox':
gc_gc_process_choice_checkbox_field($entity, $local_field_name, $is_translatable, $language, $field->options);
break;
case 'section':
gc_gc_process_section_field($entity, $local_field_name, $is_translatable, $language, $field);
break;
default:
gc_gc_process_default_field($entity, $local_field_name, $is_translatable, $language, $field);
break;
}
}