From c7fd05cc47edf734d27d327155b76b1bfa3a3189 Mon Sep 17 00:00:00 2001 From: Marco Villegas Date: Tue, 21 Jun 2011 17:05:12 -0500 Subject: [PATCH] Add prepareRow() call on MigrateSourceMSSQL::next(). --- plugins/sources/mssql.inc | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/plugins/sources/mssql.inc b/plugins/sources/mssql.inc index 780f1b3..4356bb5 100644 --- a/plugins/sources/mssql.inc +++ b/plugins/sources/mssql.inc @@ -267,7 +267,20 @@ class MigrateSourceMSSQL extends MigrateSource { $migration->showMessage(print_r($this->currentRow, TRUE)); } - $this->numProcessed++; + // Allow the Migration to prepare this row. prepareRow() can return boolean + // FALSE to stop processing this row. To add/modify fields on the + // result, modify $row by reference. + $return = TRUE; + if (method_exists($migration, 'prepareRow')) { + $return = $migration->prepareRow($this->currentRow); + } + + if ($return !== FALSE) { + $this->numProcessed++; + } + else { + $this->numIgnored++; + } } } -- 1.7.5.3