Update 2024-10-15 04:21:01
This commit is contained in:
parent
1a74439a89
commit
ab9fb353ba
@ -14,7 +14,7 @@
|
||||
@startuml
|
||||
abstract Import #Orange {
|
||||
# Items $items
|
||||
# Import $import
|
||||
# ImportEngine $import
|
||||
# string $queueTable
|
||||
# string $targetName
|
||||
# string $targetImportClass
|
||||
|
@ -18,8 +18,8 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use VDM\Joomla\Componentbuilder\Import\Factory as ImportFactory;
|
||||
use VDM\Joomla\Componentbuilder\Interfaces\Spreadsheet\ImportCliInterface as ImportEngine;
|
||||
use VDM\Joomla\Data\Items;
|
||||
use VDM\Joomla\Componentbuilder\Interfaces\Spreadsheet\ImportCliInterface as Import;
|
||||
use VDM\Joomla\Utilities\Component\Helper;
|
||||
|
||||
|
||||
@ -41,10 +41,10 @@ abstract class Import extends AbstractCommand
|
||||
/**
|
||||
* The Import Class.
|
||||
*
|
||||
* @var Import
|
||||
* @var ImportEngine
|
||||
* @since 5.0.2
|
||||
*/
|
||||
protected Import $import;
|
||||
protected ImportEngine $import;
|
||||
|
||||
/**
|
||||
* The queue table name.
|
||||
|
@ -9,10 +9,10 @@
|
||||
/**
|
||||
* The Import Class.
|
||||
*
|
||||
* @var Import
|
||||
* @var ImportEngine
|
||||
* @since 5.0.2
|
||||
*/
|
||||
protected Import $import;
|
||||
protected ImportEngine $import;
|
||||
|
||||
/**
|
||||
* The queue table name.
|
||||
|
@ -14,14 +14,14 @@
|
||||
"use": "ff8d5fdb-2d1f-4178-bd18-a43b8efd1068",
|
||||
"as": "ImportFactory"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "0f3f7188-3e0d-4d1a-8dee-7f8026cb65a9",
|
||||
"as": "ImportEngine"
|
||||
},
|
||||
"use_selection1": {
|
||||
"use": "21bca8a4-5b28-41c4-843e-8097f0ba7cca",
|
||||
"as": "default"
|
||||
},
|
||||
"use_selection2": {
|
||||
"use": "0f3f7188-3e0d-4d1a-8dee-7f8026cb65a9",
|
||||
"as": "Import"
|
||||
},
|
||||
"use_selection3": {
|
||||
"use": "640b5352-fb09-425f-a26e-cd44eda03f15",
|
||||
"as": "default"
|
||||
|
@ -14,7 +14,7 @@
|
||||
class Importer << (F,LightGreen) >> #RoyalBlue {
|
||||
# FileReader $filereader
|
||||
+ __construct(FileReader $filereader)
|
||||
+ read(string $filePath, int $startRow = 1, ...) : \Generator
|
||||
+ read(string $filePath, int $startRow, ...) : \Generator
|
||||
}
|
||||
|
||||
note right of Importer::__construct
|
||||
@ -31,8 +31,8 @@ note right of Importer::read
|
||||
|
||||
arguments:
|
||||
string $filePath
|
||||
int $startRow = 1
|
||||
int $chunkSize = 100
|
||||
int $startRow
|
||||
int $chunkSize
|
||||
RowDataProcessor $processor
|
||||
end note
|
||||
|
||||
|
@ -47,8 +47,8 @@ final class Importer
|
||||
* Stream rows from a CSV or Excel file one by one using yield.
|
||||
*
|
||||
* @param string $filePath The path to the file.
|
||||
* @param int $startRow The starting row index (default is 1).
|
||||
* @param int $chunkSize The number of rows to read per chunk (default is 100).
|
||||
* @param int $startRow The starting row index.
|
||||
* @param int $chunkSize The number of rows to read per chunk.
|
||||
* @param RowDataProcessor $processor The processor used to transform the row data into the desired format.
|
||||
*
|
||||
* @return \Generator A generator that yields each row as an array.
|
||||
@ -58,7 +58,7 @@ final class Importer
|
||||
* @throws SpreadsheetException If there is an error working with the spreadsheet.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function read(string $filePath, int $startRow = 1, int $chunkSize = 100, RowDataProcessor $processor): \Generator
|
||||
public function read(string $filePath, int $startRow, int $chunkSize, RowDataProcessor $processor): \Generator
|
||||
{
|
||||
foreach ($this->filereader->read($filePath, $startRow, $chunkSize) as $row)
|
||||
{
|
||||
|
@ -22,8 +22,8 @@
|
||||
* Stream rows from a CSV or Excel file one by one using yield.
|
||||
*
|
||||
* @param string $filePath The path to the file.
|
||||
* @param int $startRow The starting row index (default is 1).
|
||||
* @param int $chunkSize The number of rows to read per chunk (default is 100).
|
||||
* @param int $startRow The starting row index.
|
||||
* @param int $chunkSize The number of rows to read per chunk.
|
||||
* @param RowDataProcessor $processor The processor used to transform the row data into the desired format.
|
||||
*
|
||||
* @return \Generator A generator that yields each row as an array.
|
||||
@ -33,7 +33,7 @@
|
||||
* @throws SpreadsheetException If there is an error working with the spreadsheet.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function read(string $filePath, int $startRow = 1, int $chunkSize = 100, RowDataProcessor $processor): \Generator
|
||||
public function read(string $filePath, int $startRow, int $chunkSize, RowDataProcessor $processor): \Generator
|
||||
{
|
||||
foreach ($this->filereader->read($filePath, $startRow, $chunkSize) as $row)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user