if ($count === 0
) { $this->io->
success('No carts found in Redis'
);
return 0;
} $this->progress =
$this->io->
createProgressBar((int) $count);
$this->progress->
setFormat("<info>[%message%]</info>\n%current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%"
);
$this->progress->
setMessage('Migrating carts from SQL to Redis'
);
$iterator =
$this->
createIterator();
// @deprecated tag:v6.6.0 - payload always exists
$payloadExists = EntityDefinitionQueryHelper::
columnExists($this->connection, 'cart', 'payload'
);
while ($tokens =
$iterator->
fetch()) { $rows =
$this->connection->
fetchAllAssociative('SELECT * FROM cart WHERE token IN (:tokens)',
['tokens' =>
$tokens],
['tokens' => ArrayParameterType::STRING
]);
$values =
[];
foreach ($rows as $row) { $key = RedisCartPersister::PREFIX .
$row['token'
];