->
limit(100
);
$customers =
$this->numberSearch->
search($criteria);
$helper->
start($customers->
getTotal(), 'Start indexing customers'
);
$this->
clearStreamIndex($streamId);
$insert =
$this->connection->
prepare( 'INSERT INTO s_customer_streams_mapping (stream_id, customer_id) VALUES (:streamId, :customerId)'
);
while ($customers->
getCustomers()) { foreach ($customers->
getIds() as $customerId) { $insert->
execute([ ':streamId' =>
$streamId,
':customerId' =>
$customerId,
]);
} $helper->
advance((int) $criteria->
getLimit());
$criteria->
offset($criteria->
getOffset() +
$criteria->
getLimit());
$customers =
$this->numberSearch->
search($criteria);
}