1 | <?php |
||
10 | abstract class Batch extends Resource |
||
11 | { |
||
12 | private $batch = []; |
||
13 | private $batchSize; |
||
14 | private $account; |
||
|
|||
15 | |||
16 | public function __construct(Account $account=null, $batchSize=10, $batch=[]) |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function getId() |
||
32 | |||
33 | public function getAccount() |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function toParams() |
||
51 | |||
52 | public function getBatch() |
||
56 | |||
57 | public function add(Arrayable $data) |
||
63 | |||
64 | /** |
||
65 | * Assures the batch is not over the batch size limit. |
||
66 | * |
||
67 | * @param $batch|null |
||
68 | * |
||
69 | * @throws BatchLimitExceeded when the batch is full |
||
70 | * @return $batch|$this->batch |
||
71 | */ |
||
72 | public function assureBatchSize($batch=null) |
||
83 | } |
||
84 |