1 | <?php |
||
5 | class DataLoaderOptions |
||
6 | { |
||
7 | /** |
||
8 | * @var bool |
||
9 | */ |
||
10 | private $shouldBatch; |
||
11 | |||
12 | /** |
||
13 | * @var null|int |
||
14 | */ |
||
15 | private $maxBatchSize; |
||
16 | |||
17 | /** |
||
18 | * @var bool |
||
19 | */ |
||
20 | private $shouldCache; |
||
21 | |||
22 | /** |
||
23 | * Initiates new DataLoaderOptions. |
||
24 | * |
||
25 | * @param null|int $maxBatchSize |
||
26 | * @param bool $shouldBatch |
||
27 | * @param bool $shouldCache |
||
28 | */ |
||
29 | 36 | public function __construct( |
|
39 | |||
40 | /** |
||
41 | * @return bool |
||
42 | */ |
||
43 | 30 | public function shouldBatch() |
|
47 | |||
48 | /** |
||
49 | * @return null|int |
||
50 | */ |
||
51 | 29 | public function getMaxBatchSize() |
|
55 | |||
56 | /** |
||
57 | * @return bool |
||
58 | */ |
||
59 | 31 | public function shouldCache() |
|
63 | |||
64 | /** |
||
65 | * Validates the options. |
||
66 | * |
||
67 | * @param null|int $maxBatchSize |
||
68 | * @param bool $shouldBatch |
||
69 | * @param bool $shouldCache |
||
70 | */ |
||
71 | 36 | private function validateOptions($maxBatchSize, $shouldBatch, $shouldCache) |
|
77 | |||
78 | /** |
||
79 | * @param bool $shouldBatch |
||
80 | */ |
||
81 | 35 | private function validateBatchOption($shouldBatch) |
|
87 | |||
88 | /** |
||
89 | * @param bool $shouldCache |
||
90 | */ |
||
91 | 34 | private function validateCacheOption($shouldCache) |
|
97 | |||
98 | /** |
||
99 | * @param null|int $maxBatchSize |
||
100 | */ |
||
101 | 36 | private function validateMaxBatchSizeOption($maxBatchSize) |
|
107 | } |
||
108 |