From 3fca5468aca90342613fb6ebfba5336a7310174f Mon Sep 17 00:00:00 2001 From: "Paul M. Jones" Date: Thu, 19 Apr 2018 07:27:54 -0500 Subject: [PATCH] on second thought, RecordSets might contain records from different mappers --- src/Mapper.php | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/Mapper.php b/src/Mapper.php index fe36683..649976a 100644 --- a/src/Mapper.php +++ b/src/Mapper.php @@ -199,7 +199,7 @@ public function delete(Record $record) : void } public function persist( - $recordOrRecordSet, + Record $record, SplObjectStorage $tracker = null ) : void { @@ -207,24 +207,6 @@ public function persist( $tracker = new SplObjectStorage(); } - if ($recordOrRecordSet instanceof Record) { - $this->persistRecord($recordOrRecordSet, $tracker); - return; - } - - if ($recordOrRecordSet instanceof RecordSet) { - $this->persistRecordSet($recordOrRecordSet, $tracker); - return; - } - - throw Exception::invalidType('Record or RecordSet', $recordOrRecordSet); - } - - protected function persistRecord( - Record $record, - SplObjectStorage $tracker - ) : void - { if ($tracker->contains($record)) { return; } @@ -243,17 +225,6 @@ protected function persistRecord( $this->relationships->persistAfterNative($record, $tracker); } - protected function persistRecordSet( - RecordSet $recordSet, - SplObjectStorage $tracker - ) : void - { - foreach ($recordSet as $record) { - $this->persistRecord($record, $tracker); - } - $recordSet->detachDeleted(); - } - public function newRecord(array $fields = []) : Record { $row = $this->table->newRow($fields);