abstract class BatchProcessorBase in Content Synchronizer 8
Same name and namespace in other branches
- 8.2 src/Base/BatchProcessorBase.php \Drupal\content_synchronizer\Base\BatchProcessorBase
- 3.x src/Base/BatchProcessorBase.php \Drupal\content_synchronizer\Base\BatchProcessorBase
Batch Processor base.
Hierarchy
- class \Drupal\content_synchronizer\Base\BatchProcessorBase
Expanded class hierarchy of BatchProcessorBase
2 files declare their use of BatchProcessorBase
- BatchExportProcessor.php in src/
Processors/ BatchExportProcessor.php - BatchImportProcessor.php in src/
Processors/ BatchImportProcessor.php
File
- src/
Base/ BatchProcessorBase.php, line 8
Namespace
Drupal\content_synchronizer\BaseView source
abstract class BatchProcessorBase {
/**
* Callback method.
*/
public static abstract function onFinishBatchProcess($success, $results, $operations);
/**
* Operation callback.
*/
public static abstract function processBatchOperation(array $oprationData, array $context);
/**
* Call the callback method if defined.
*/
protected static function callFinishCallback($finishCallback = NULL, $data = NULL) {
if (is_array($finishCallback)) {
list($object, $method) = $finishCallback;
if (method_exists($object, $method)) {
if ($data) {
$object
->{$method}($data);
}
else {
$object
->{$method}();
}
}
}
elseif (is_string($finishCallback)) {
if (function_exists($finishCallback)) {
if ($data) {
$finishCallback($data);
}
else {
$finishCallback();
}
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BatchProcessorBase:: |
protected static | function | Call the callback method if defined. | |
BatchProcessorBase:: |
abstract public static | function | Callback method. | 2 |
BatchProcessorBase:: |
abstract public static | function | Operation callback. | 2 |