migrating from multiple csv files in one migration class I have multiple CSV files in different folders. 
The folder names are the node ids. And each folder contains its own CSV file.
Now I want to loop these directories and import from the CSV files in one migration class but it only migrate from the last CSV  file.

Here is my code

class MigrateNodes extends Migration {
  public function __construct($arguments) {
    parent::__construct();
    $columns[0] = array('Number', 'Number');
    $columns[1] = array('Title', 'Title');
    $columns[2] = array('Description', 'Description');
    //The Description of the import. This desription is shown on the Migrate GUI
    $this-&gt;description = t('Import lots from excell file ');
    $nids = db_select('node', 'n')
        -&gt;fields('n', array('nid'))
        -&gt;condition('n.type', 'type')
        -&gt;execute()
        -&gt;fetchCol();
    foreach ($nids as $nid) {
   $path = $nid . "/nodes.csv";
      //The Source of the import
      $this-&gt;source = new MigrateSourceCSV($path', $columns, array('header_rows' =&gt; 1));
      if ($this-&gt;source) {
        $this-&gt;destination = new MigrateDestinationNode('lot');
        $this-&gt;map = new MigrateSQLMap(
            $this-&gt;machineName, array(
          "Number" =&gt; array(
            'type' =&gt; 'int',
            'unsigned' =&gt; TRUE,
            'not null' =&gt; TRUE,
            'alias' =&gt; 'import'
          )
            ), MigrateDestinationNode::getKeySchema()
        );
        //Field ampping
        $this-&gt;addFieldMapping('title', 'Title');
        $this-&gt;addFieldMapping('field_lot_description', 'Description');
      //}
      }
   }
  }
}


The Number field is unique.
Any one knows what I am doing wrong?
I have solved it.
Just place the following line after the field mappings if it is the import process.

$this-&gt;processImport();