@@ -208,9 +208,10 @@ public function matchingFirstOrFail(string $expression): TabularDataReader
208
208
*/
209
209
public function getRecords (array $ header = []): Iterator
210
210
{
211
- $ header = $ this ->prepareHeader ($ header );
211
+ $ iterator = $ this ->combineHeader ($ this ->prepareHeader ($ header ));
212
+ $ iterator ->rewind ();
212
213
213
- return $ this -> combineHeader ( $ header ) ;
214
+ return $ iterator ;
214
215
}
215
216
216
217
/**
@@ -221,7 +222,7 @@ public function getRecords(array $header = []): Iterator
221
222
* @throws MappingFailed
222
223
* @throws TypeCastingFailed
223
224
*/
224
- public function getObjects (string $ className , array $ header = []): Iterator
225
+ public function getRecordsAsObject (string $ className , array $ header = []): Iterator
225
226
{
226
227
$ header = $ this ->prepareHeader ($ header );
227
228
@@ -434,10 +435,10 @@ public function fetchPairs($offset_index = 0, $value_index = 1): Iterator
434
435
}
435
436
436
437
/**
437
- * @deprecated since version 9.9.0
438
- *
439
- * @see ::nth
438
+ * DEPRECATION WARNING! This method will be removed in the next major point release.
440
439
*
440
+ * @see ResultSet::nth()
441
+ * @deprecated since version 9.9.0
441
442
* @codeCoverageIgnore
442
443
*/
443
444
public function fetchOne (int $ nth_record = 0 ): array
@@ -446,18 +447,38 @@ public function fetchOne(int $nth_record = 0): array
446
447
}
447
448
448
449
/**
449
- * @deprecated since version 9.8.0
450
- *
451
- * @see ::fetchColumnByName
452
- * @see ::fetchColumnByOffset
450
+ * DEPRECATION WARNING! This method will be removed in the next major point release.
453
451
*
452
+ * @see ResultSet::fetchColumnByOffset()
453
+ * @see ResultSet::fetchColumnByName()
454
+ * @deprecated Since version 9.8.0
454
455
* @codeCoverageIgnore
455
- * @throws Exception
456
+ *
457
+ * @param string|int $index
456
458
*/
457
459
public function fetchColumn ($ index = 0 ): Iterator
458
460
{
459
461
return $ this ->yieldColumn (
460
462
$ this ->getColumnIndex ($ index , 'offset ' , __METHOD__ )
461
463
);
462
464
}
465
+
466
+ /**
467
+ * DEPRECATION WARNING! This method will be removed in the next major point release.
468
+ *
469
+ * @see Reader::getRecordsAsObject()
470
+ * @deprecated Since version 9.15.0
471
+ * @codeCoverageIgnore
472
+ *
473
+ * @param class-string $className
474
+ * @param array<string> $header
475
+ *
476
+ * @throws Exception
477
+ * @throws MappingFailed
478
+ * @throws TypeCastingFailed
479
+ */
480
+ public function getObjects (string $ className , array $ header = []): Iterator
481
+ {
482
+ return $ this ->getRecordsAsObject ($ className , $ header );
483
+ }
463
484
}
0 commit comments