Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
BatchProvider Class Reference
Inheritance diagram for BatchProvider:
BatchProviderInterface

Public Member Functions

 getBatchIds (\Magento\Framework\DB\Adapter\AdapterInterface $connection, \Magento\Framework\DB\Select $select, array $batch)
 
- Public Member Functions inherited from BatchProviderInterface
 getBatches (AdapterInterface $adapter, $tableName, $linkField, $batchSize)
 
 getBatchIds (AdapterInterface $connection, Select $select, array $batch)
 

Detailed Description

Generator of consecutive entity ID ranges that must be handled as a batch.

Some ranges may contain non existent entity IDs. So the code that uses the generator must check if any entities were loaded during batch load.

Definition at line 16 of file BatchProvider.php.

Member Function Documentation

◆ getBatchIds()

getBatchIds ( \Magento\Framework\DB\Adapter\AdapterInterface  $connection,
\Magento\Framework\DB\Select  $select,
array  $batch 
)

Definition at line 49 of file BatchProvider.php.

53  {
54  $betweenCondition = sprintf(
55  '(%s BETWEEN %s AND %s)',
56  'entity_id',
57  $connection->quote($batch['from']),
58  $connection->quote($batch['to'])
59  );
60 
61  $ids = $connection->fetchCol($select->where($betweenCondition));
62  return array_map('intval', $ids);
63  }
$connection
Definition: bulk.php:13

The documentation for this class was generated from the following file: