You are here

public function FeedsCommerceCustomerProfileProcessor::setTargetElement in Commerce Feeds 7

Override setTargetElement to operate on a target item.

File

plugins/FeedsCommerceCustomerProfileProcessor.inc, line 124
Class definition of FeedsCommerceCustomerProfileProcessor.

Class

FeedsCommerceCustomerProfileProcessor
Creates profiles from feed items.

Code

public function setTargetElement(FeedsSource $source, $target_entity, $target_element, $value) {
  switch ($target_element) {
    case 'type':
      $profile_types = commerce_customer_profile_type_get_name();
      $target_entity->type = $value;
      if (!array_key_exists($value, $profile_types)) {
        $target_entity->type = $this->config['customer_profile_type'];
      }
      break;
    case 'uid':
      $target_entity->uid = $value;
      break;
    default:
      parent::setTargetElement($source, $target_entity, $target_element, $value);
      break;
  }
}