| @@ 277-288 (lines=12) @@ | ||
| 274 | * @param int $previous_interval_end The last item from the previous interval. |
|
| 275 | * @return array Chunk IDs with the previous interval end. |
|
| 276 | */ |
|
| 277 | protected function get_chunks_with_preceding_end( $chunks, $previous_interval_end ) { |
|
| 278 | $chunks_with_ends = array(); |
|
| 279 | foreach ( $chunks as $chunk ) { |
|
| 280 | $chunks_with_ends[] = array( |
|
| 281 | 'ids' => $chunk, |
|
| 282 | 'previous_end' => $previous_interval_end, |
|
| 283 | ); |
|
| 284 | // Chunks are ordered in descending order. |
|
| 285 | $previous_interval_end = end( $chunk ); |
|
| 286 | } |
|
| 287 | return $chunks_with_ends; |
|
| 288 | } |
|
| 289 | ||
| 290 | /** |
|
| 291 | * Get metadata of a particular object type within the designated meta key whitelist. |
|
| @@ 148-157 (lines=10) @@ | ||
| 145 | * @param int $previous_interval_end The last item from the previous interval. |
|
| 146 | * @return array Chunk IDs with the previous interval end. |
|
| 147 | */ |
|
| 148 | protected function get_chunks_with_preceding_end( $chunks, $offset ) { |
|
| 149 | $chunks_with_ends = array(); |
|
| 150 | foreach ( $chunks as $chunk ) { |
|
| 151 | $chunks_with_ends[] = array( |
|
| 152 | 'ids' => $chunk, |
|
| 153 | 'offset' => $offset += count( $chunk ), |
|
| 154 | ); |
|
| 155 | } |
|
| 156 | return $chunks_with_ends; |
|
| 157 | } |
|
| 158 | ||
| 159 | ||
| 160 | /** |
|