From 6f48c8311e98ae405fa21e3bc432beb38c43237e Mon Sep 17 00:00:00 2001 From: aaleks1 Date: Mon, 24 Mar 2025 21:10:31 -0500 Subject: [PATCH] Add "ignoreDeleted" Option to Handle Deleted Records This contribution introduces a new feature to the class: the option. By default, deleted records are ignored during iteration. However, with this new option, developers can choose to include deleted records in their queries for processing or analysis. --- src/TableReader.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/TableReader.php b/src/TableReader.php index 71023e3..9cce5c7 100644 --- a/src/TableReader.php +++ b/src/TableReader.php @@ -81,6 +81,7 @@ protected function resolveOptions(array $options): array 'columns' => [], 'encoding' => null, 'editMode' => null, + 'ignoreDeleted' => true, ], $options); } @@ -155,6 +156,9 @@ public function nextRecord(): ?RecordInterface if ($this->record->isDeleted()) { $this->deleteCount++; + if($this->table->options['ignoreDeleted'] === false) { + $valid = true; + } } else { $valid = true; } @@ -219,6 +223,9 @@ public function previousRecord(): ?RecordInterface if ($this->record->isDeleted()) { $this->deleteCount++; + if($this->table->options['ignoreDeleted'] === false) { + $valid = true; + } } else { $valid = true; }