Skip to content
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.

Commit

Permalink
Update MultiDatabasePDO-Statement.php
Browse files Browse the repository at this point in the history
  • Loading branch information
WulfGamesYT committed Mar 30, 2019
1 parent 9564adc commit cf48a6e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/MultiDatabasePDO-Statement.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php
namespace WulfGamesYT\MultiDatabasePDO;
use PDO;
use PDO, Exception;

class MultiDatabasePDOStatement {

//The original PDO databases.
private $originalPDODatabases = [];

//All the prepared statements and returned rows.
private $preparedStatements = [];
private $returnedRows = [];

Expand Down Expand Up @@ -119,10 +116,8 @@ public function getNextRow() : ?array {
* @method Limits the returned rows to a specific amount, with an optional offset.
**/
public function limitTo(int $limit, int $offset = 0) {
if(count($this->returnedRows) > $limit) {
if(count($this->returnedRows) >= $limit) {
$this->returnedRows = array_slice($this->returnedRows, $offset, $limit === -1 ? PHP_INT_MAX : $limit);
} else {
$this->returnedRows = [];
}
}

Expand Down

0 comments on commit cf48a6e

Please sign in to comment.