You are here

public function MigrateBatchExecutable::calculateBatchLimit in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8.4 src/MigrateBatchExecutable.php \Drupal\migrate_tools\MigrateBatchExecutable::calculateBatchLimit()

Calculates how much a single batch iteration will handle.

Parameters

array|\DrushBatchContext $context: The sandbox context.

Return value

float The batch limit.

File

src/MigrateBatchExecutable.php, line 309

Class

MigrateBatchExecutable
Defines a migrate executable class for batch migrations through UI.

Namespace

Drupal\migrate_tools

Code

public function calculateBatchLimit($context) {

  // TODO Maybe we need some other more sophisticated logic here?
  return ceil($context['sandbox']['total'] / 100);
}