You are here

public function SalesforceMapping::getPullFields in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::getPullFields()
  2. 5.0.x modules/salesforce_mapping/src/Entity/SalesforceMapping.php \Drupal\salesforce_mapping\Entity\SalesforceMapping::getPullFields()

Get all the field plugins which are configured to pull from Salesforce.

Return value

\Drupal\salesforce_mapping\SalesforceMappingFieldPluginInterface[] Array of objects.

Overrides SalesforceMappingInterface::getPullFields

File

modules/salesforce_mapping/src/Entity/SalesforceMapping.php, line 402

Class

SalesforceMapping
Defines a Salesforce Mapping configuration entity class.

Namespace

Drupal\salesforce_mapping\Entity

Code

public function getPullFields() {

  // @TODO This should probably be delegated to a field plugin bag?
  $fields = [];
  foreach ($this
    ->getFieldMappings() as $i => $field_plugin) {

    // Skip fields that aren't being pulled from Salesforce.
    if (!$field_plugin
      ->pull()) {
      continue;
    }
    $fields[$i] = $field_plugin;
  }
  return $fields;
}