public function PushParams::__construct in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/PushParams.php \Drupal\salesforce_mapping\PushParams::__construct()
- 8.3 modules/salesforce_mapping/src/PushParams.php \Drupal\salesforce_mapping\PushParams::__construct()
Given a Drupal entity, return an array of Salesforce key-value pairs.
Parameters
\Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping: Salesforce Mapping.
\Drupal\Core\Entity\EntityInterface $entity: Drupal entity.
array $params: Initial params values (optional).
File
- modules/
salesforce_mapping/ src/ PushParams.php, line 46
Class
- PushParams
- Wrapper for the array of values which will be pushed to Salesforce.
Namespace
Drupal\salesforce_mappingCode
public function __construct(SalesforceMappingInterface $mapping, EntityInterface $entity, array $params = []) {
$this->mapping = $mapping;
$this->drupalEntity = $entity;
$this->params = $params;
foreach ($mapping
->getFieldMappings() as $field_plugin) {
// Skip fields that aren't being pushed to Salesforce.
if (!$field_plugin
->push()) {
continue;
}
$this->params[$field_plugin
->config('salesforce_field')] = $field_plugin
->pushValue($entity, $mapping);
}
}