| | |
| | | |
| | | use JVBase\managers\queue\Mergeable; |
| | | use JVBase\managers\queue\Operation; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | /** |
| | | * Default merger, uses the chunkKey as the mergeable array |
| | | */ |
| | |
| | | public function merge(Operation $existing, Operation $incoming): Operation |
| | | { |
| | | foreach ((array) $this->chunkKey as $key) { |
| | | $existing->requestData[$key] = array_merge( |
| | | $existing->requestData[$key] = array_replace( |
| | | $existing->requestData[$key] ?? [], |
| | | $incoming->requestData[$key] ?? [] |
| | | ); |
| | |
| | | $existing->totalItems += $incoming->totalItems; |
| | | return $existing; |
| | | } |
| | | public function matchCriteria(Operation $incoming): array |
| | | { |
| | | return []; |
| | | } |
| | | } |