$backup =
$entityManager->
find(BackupModel::
class,
$id);
if (!
$backup instanceof BackupModel
) { throw new RuntimeException(sprintf('Backup by id %d not found',
$id));
} $path =
$backup->
getPath();
$dir = \
dirname($path);
// Only unzip at the first time
if ((int) $offset === 0
) { $this->
extractedFilesFromZip($path,
$dir);
} // Get list of data sql files
$dataFiles =
$this->
getDirectoryList($dir . '/',
['datasql'
]);
$numFiles = null;
if (!
empty($dataFiles)) { $tables =
[];
// Group by table
foreach ($dataFiles as $file) {