Migrate multiple source data rows
I found out that sourceMigration() doesn't allow multiple data source data rows (but please correct me if I'm wrong). So, I made a custom query in my prepareRow() that somehow works like sourceMigration. Here's what I did:



// group concat code
$query->addExpression('GROUP_CONCAT(file.field_file_fid)', 'file_id');

// in field mapping
$this->addFieldMapping('commerce_file', 'file_id');
$this->addFieldMapping('commerce_file:file_class')
      ->defaultValue('MigrateFileFid');

// in prepareRow()
public function prepareRow($row) {
  if (parent::prepareRow($row) === FALSE) {
    return FALSE;
  }

  // get the values of the file_id where you used group concat function
  $product_id1 = explode(",", $row->file_id); //convert csv to array
  $product_id1 = array_values($product_id1); //redeclare it to clear its index / optional
  $newsIds = array(); //array where the ids will be stored

  foreach ($product_id1 as $i) { //loop through array
      $getEquivalentId = db_select('migrate_map_privatefile', 'p') //'migrate_map_privatefile' is the migrate map table where the ids of the files are stored
              ->fields('p', array('destid1')) 
              ->condition('p.sourceid1', $i);
      $resultOfId = $getEquivalentId->execute();
      foreach ($resultOfId as $id) {
        $newsIds[] = $id->destid1; //store result to $newsIds
      }

    }

    $row->file_id = $newsIds; //the values of file_id will now be $newsIds

  }



Hope this would help someone, someday.
Cheers!