diff -u b/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php --- b/core/modules/migrate/src/MigrateExecutable.php +++ b/core/modules/migrate/src/MigrateExecutable.php @@ -605,43 +605,57 @@ } /** - * Allows access to protected successesSinceFeedback property. + * Returns the number of items successfully imported since the last feedback. + * + * @param boolean $reset + * TRUE to reset the number of successes since feedback to 0. * * @return int - * The value of the protected property. + * The number of successes since last feedback. */ - public function getSuccessesSinceFeedback() { - return $this->successesSinceFeedback; + public function getSuccessesSinceFeedback($reset = FALSE) { + $num_successes = $this->successesSinceFeedback; + if ($reset) { + $this->successesSinceFeedback = 0; + } + return $num_successes; } /** - * Allows access to protected totalSuccesses property. + * Returns the number of items successfully imported on this run. * * @return int - * The value of the protected property. + * The total number of successes. */ public function getTotalSuccesses() { return $this->totalSuccesses; } /** - * Allows access to protected totalProcessed property. + * Returns the number of items processed since the last feedback. + * + * @param boolean $reset + * TRUE to reset the number of processed since feedback to 0. * * @return int - * The value of the protected property. + * The number of items processed since last feedback. */ - public function getTotalProcessed() { - return $this->totalProcessed; + public function getProcessedSinceFeedback($reset = FALSE) { + $num_processed = $this->processedSinceFeedback; + if ($reset) { + $this->processedSinceFeedback = 0; + } + return $num_processed; } /** - * Allows access to protected processedSinceFeedback property. + * Returns the number of items processed on this run. * * @return int - * The value of the protected property. + * The total number of items processed. */ - public function getProcessedSinceFeedback() { - return $this->processedSinceFeedback; + public function getTotalProcessed() { + return $this->totalProcessed; } /** only in patch2: unchanged: --- a/core/modules/migrate/src/MigrateExecutableInterface.php +++ b/core/modules/migrate/src/MigrateExecutableInterface.php @@ -45,6 +45,44 @@ public function processRow(Row $row, array $process = NULL, $value = NULL); public function getTimeLimit(); /** + * Returns the number of items successfully imported since the last feedback. + * + * @param boolean $reset + * TRUE to reset the number of successes since feedback to 0. + * + * @return int + * The number of successes since last feedback. + */ + public function getSuccessesSinceFeedback($reset = FALSE); + + /** + * Returns the number of items successfully imported on this run. + * + * @return int + * The total number of successes. + */ + public function getTotalSuccesses(); + + /** + * Returns the number of items processed since the last feedback. + * + * @param boolean $reset + * TRUE to reset the number of processed since feedback to 0. + * + * @return int + * The number of items processed since last feedback. + */ + public function getProcessedSinceFeedback($reset = FALSE); + + /** + * Returns the number of items processed on this run. + * + * @return int + * The total number of items processed. + */ + public function getTotalProcessed(); + + /** * Passes messages through to the map class. * * @param string $message