/var/www/html_uk/wp-content/plugins/automatewoo/includes/Triggers/BatchedWorkflowInterface.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

namespace AutomateWoo\Triggers;

use 
AutomateWoo\Workflow;

/**
 * Interface BatchedWorkflowInterface
 *
 * Triggers can implement this interface to be compatible with the BatchedWorkflows job.
 *
 * @since 5.1.0
 */
interface BatchedWorkflowInterface {

    
/**
     * Get a batch of items to process for given workflow.
     *
     * @param Workflow $workflow
     * @param int      $offset The batch query offset.
     * @param int      $limit  The max items for the query.
     *
     * @return array[] Array of items in array format. Items will be stored in the database so they should be IDs not objects.
     */
    
public function get_batch_for_workflowWorkflow $workflowint $offsetint $limit ): array;

    
/**
     * Process a single item for a workflow to process.
     *
     * @param Workflow $workflow
     * @param array    $item
     */
    
public function process_item_for_workflowWorkflow $workflow, array $item );
}