You are here

public function SocialMediaLinksFieldMapping::getEntityComponentFields in Webform Content Creator 3.x

Returns the entity component fields.

Return value

array returns an array of the component fields that makeup this field

Overrides FieldMappingBase::getEntityComponentFields

File

src/Plugin/WebformContentCreator/FieldMapping/SocialMediaLinksFieldMapping.php, line 25

Class

SocialMediaLinksFieldMapping
Provides social media links field mapping.

Namespace

Drupal\webform_content_creator\Plugin\WebformContentCreator\FieldMapping

Code

public function getEntityComponentFields(FieldDefinitionInterface $field_definition) {
  $platforms = $field_definition
    ->getSetting("platforms");
  $available_platforms = [];
  foreach ($platforms as $key => $platform) {
    if ($platform['enabled'] == 1) {
      $available_platforms[] = $key;
    }
  }
  return $available_platforms;
}