Add debug to document list
This commit is contained in:
parent
3d45bbcabc
commit
4342d1ac50
|
@ -46,8 +46,15 @@ class DocumentList
|
||||||
*/
|
*/
|
||||||
public function items(): Generator
|
public function items(): Generator
|
||||||
{
|
{
|
||||||
|
$debug = defined('PDO_DOC_DEBUG_SQL');
|
||||||
|
|
||||||
if ($this->result) {
|
if ($this->result) {
|
||||||
while ($row = $this->result->fetch(PDO::FETCH_ASSOC)) yield $this->mapper->map($row);
|
while ($row = $this->result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
if ($debug) echo "<pre>Returning an item\n</pre>";
|
||||||
|
yield $this->mapper->map($row);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($debug) echo 'Nothing to return';
|
||||||
}
|
}
|
||||||
$this->result = null;
|
$this->result = null;
|
||||||
$this->pdo = null;
|
$this->pdo = null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user