public function Batch::processNode in Node Revisions Autoclean 8
File
- src/
Batch/ Batch.php, line 9
Class
Namespace
Drupal\node_revisions_autoclean\BatchCode
public function processNode($id, $nid, &$context) {
$node = Node::load($nid);
/* @var $revisionsManager \Drupal\node_revisions_autoclean\Services\RevisionsManager */
$revisionsManager = \Drupal::service('node_revisions_autoclean.revisions_manager');
$revisions = $revisionsManager
->revisionsToDelete($node);
$revisionsManager
->deleteRevisions($revisions);
$context['results'][] = $id;
$context['message'] = t('Running Batch node revisions autoclean "@id" on node @nid', [
'@id' => $id,
'@nid' => $nid,
]);
}