- Issue created by @swirt
- πΊπΈUnited States swirt Florida
Crediting Mile23 for the suggestion of adding this.
- πΊπΈUnited States swirt Florida
There is some logic now present to determine if a batch operation has been run before. I am not clear if this need would be to only run A if B. and C were just run .. or if they were ever previously run.
It is already possible through using the 'preBatchMethod($sandbox)' or 'postBatchMethod($sandbox)' to call another BatchOperation directly so a dependency could actually be performed.
Maybe this just needs documentation as an example BatchOperation.
Example:
If A needed B and C to run first, then In the batch operation for A add the optional methodpublic function preBatchMethod($sandbox) { $B = \Drupal::classResolver('\Drupal\YOUR_MODULE\cbo_scripts\B'); $B->run($sandbox, 'hook_update'); $C = \Drupal::classResolver('\Drupal\YOUR_MODULE\cbo_scripts\C'); $C->run($sandbox, 'hook_update'); return "I ran B and C. They will each have their own logs that you should see."; }