Add docs link, misc format tweaks
This commit is contained in:
@@ -21,8 +21,8 @@ use PDOStatement;
|
||||
*/
|
||||
class DocumentList
|
||||
{
|
||||
/** @var TDoc|null $_first The first item from the results */
|
||||
private mixed $_first = null;
|
||||
/** @var TDoc|null $first The first item from the results */
|
||||
private mixed $first = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -33,7 +33,7 @@ class DocumentList
|
||||
private function __construct(private ?PDOStatement &$result, private readonly Mapper $mapper)
|
||||
{
|
||||
if ($row = $this->result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$this->_first = $this->mapper->map($row);
|
||||
$this->first = $this->mapper->map($row);
|
||||
} else {
|
||||
$this->result = null;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class DocumentList
|
||||
public function items(): Generator
|
||||
{
|
||||
if (!$this->result) return;
|
||||
yield $this->_first;
|
||||
yield $this->first;
|
||||
while ($row = $this->result->fetch(PDO::FETCH_ASSOC)) {
|
||||
yield $this->mapper->map($row);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user