getEntityTypeId(); $bundle = $entity->bundle(); $settings = Drupal::service('pipedrive.entity_settings')->getSettings($entity_type, $bundle); // If the entity type is enabled to push to pipedrive. if ($settings->get('enabled')) { $values = []; foreach ($settings->get('field_mappings') as $local => $pipedrive) { $values[$local] = (string) $entity->get($local)->getString(); } // @todo get and store values. if ($values) { Drupal::service('pipedrive.sync') ->syncObject($values, $settings->get('field_mappings')); } } // @todo store the id against the entity. }