Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce_sheets
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
commerce_sheets
Commits
69ab3676
Commit
69ab3676
authored
Feb 15, 2024
by
Dimitris Bozelos
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3421720
Only read the current associated row in the loop
parent
906b3007
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Sheet/Reader.php
+16
-3
16 additions, 3 deletions
src/Sheet/Reader.php
with
16 additions
and
3 deletions
src/Sheet/Reader.php
+
16
−
3
View file @
69ab3676
...
...
@@ -156,12 +156,15 @@ class Reader implements ReaderInterface {
* The row at which to start reading.
* @param int $start_column
* The column at which to start reading.
* @param int $end_row
* The row at which to stop reading i.e. the last row to read.
*/
protected
function
doRead
(
Worksheet
$sheet
,
EntityFormatInterface
$format
,
$start_row
,
$start_column
$start_column
,
$end_row
=
NULL
)
{
$entity
=
NULL
;
$entity_type_id
=
$format
->
getEntityTypeId
();
...
...
@@ -181,6 +184,10 @@ class Reader implements ReaderInterface {
// Go through each row and read its data.
foreach
(
$sheet
->
getRowIterator
(
$start_row
)
as
$row
)
{
if
(
$end_row
!==
NULL
&&
$row
->
getRowIndex
()
===
$end_row
+
1
)
{
break
;
}
if
(
$this
->
isRowEmpty
(
$row
))
{
continue
;
}
...
...
@@ -206,7 +213,10 @@ class Reader implements ReaderInterface {
$sheet
,
$associated_format
,
$row
->
getRowIndex
(),
$associated_section
[
'start'
]
$associated_section
[
'start'
],
// Only read this row, without this it would loop over all remaining
// rows and process all associated entities.
$row
->
getRowIndex
()
);
continue
;
}
...
...
@@ -267,7 +277,10 @@ class Reader implements ReaderInterface {
$sheet
,
$associated_format
,
$row
->
getRowIndex
(),
$associated_section
[
'start'
]
$associated_section
[
'start'
],
// Only read this row, without this it would loop over all remaining
// rows and process all associated entities.
$row
->
getRowIndex
()
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment