src/Repository/DynamoDb/BatchGetItemRequest.php
private function prepareCommands(): array
    {
        $batches = array_chunk($this->queue, $this->batchSize);
        $this->queue = [];

        $commands = [];
        foreach ($batches as $batch) {
            $requests = [];
            foreach ($batch as $item) {
                if (!isset($requests[$item['table']])) {
                    $requests[$item['table']] = ['Keys' => [], 'ConsistentRead' => $this->consistentRead];
                }
                $requests[$item['table']]['Keys'][] = $item['key'];
            }
            $commands[] = $this->client->getCommand('BatchGetItem', ['RequestItems' => $requests]);
        }

        return $commands;
    }
private function prepareCommands(): array
    {
        $batches = array_chunk($this->queue, $this->batchSize);
        $this->queue = [];

        $commands = [];
        foreach ($batches as $batch) {
            $requests = [];
            foreach ($batch as $item) {
                if (!isset($requests[$item['table']])) {
                    $requests[$item['table']] = ['Keys' => [], 'ConsistentRead' => $this->consistentRead];
                }
                $requests[$item['table']]['Keys'][] = $item['key'];
            }
            $commands[] = $this->client->getCommand('BatchGetItem', ['RequestItems' => $requests]);
        }

        return $commands;
    }
private function prepareCommands ( ) : array { $ batches = array_chunk ( $ this -> queue , $ this -> batchSize ) ; $ this -> queue = [ ] ; $ commands = [ ] ; foreach ( $ batches as $ batch ) { $ requests = [ ] ; foreach ( $ batch as $ item ) { if ( ! isset ( $ requests [ $ item [ 'table' ] ] ) ) { $ requests [ $ item [ 'table' ] ] = [ 'Keys' => [ ] , 'ConsistentRead' => $ this -> consistentRead ] ; } $ requests [ $ item [ 'table' ] ] [ 'Keys' ] [ ] = $ item [ 'key' ] ; } $ commands [ ] = $ this -> client -> getCommand ( 'BatchGetItem' , [ 'RequestItems' => $ requests ] ) ; } return $ commands ; }
Creates BatchGetItem commands from the items in the queue.

@return CommandInterface[]
Creates BatchGetItem commands from the items in the queue .