Elgg  Version 4.3
Batch.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Upgrade;
4 
10 interface Batch {
11 
15  const UNKNOWN_COUNT = -1;
16 
31  public function getVersion(): int;
32 
40  public function shouldBeSkipped(): bool;
41 
55  public function needsIncrementOffset(): bool;
56 
65  public function countItems(): int;
66 
78  public function run(Result $result, $offset): Result;
79 }
const UNKNOWN_COUNT
countItems() should return this if it doesn&#39;t know how many items remain.
Definition: Batch.php:15
if(!$count) $offset
Definition: pagination.php:26
countItems()
The total number of items to process during the upgrade.
shouldBeSkipped()
Should this upgrade be skipped?
Result of a single BatchUpgrade run.
Definition: Result.php:10
needsIncrementOffset()
Should the run() method receive an offset representing all processed items?
run(Result $result, $offset)
Runs upgrade on a single batch of items.
Long running upgrades should implement this interface.
Definition: Batch.php:10
getVersion()
Version of the upgrade.