Feeds Node Processor

Allow User Name and Email

case 'user_name':
        if ($user = user_load_by_name($value)) {
          $target_node->uid = $user->uid;
        }
 break;
 case 'user_mail':
        if ($user = user_load_by_mail($value)) {
          $target_node->uid = $user->uid;
        }
 break;
public function getMappingTargets() {
    $targets['user_name'] = array(
      'name' => t('LID'),
      'description' => t('The Drupal LID of the node author.'),
    );
    $targets['user_mail'] = array(
      'name' => t('User email'),
      'description' => t('The Drupal email address of the node author.'),
    );

Posted in Drupal