diff --git a/classes/DBConnector.class.php b/classes/DBConnector.class.php index c26f3e8..51b5528 100644 --- a/classes/DBConnector.class.php +++ b/classes/DBConnector.class.php @@ -83,7 +83,7 @@ class DBConnector return mysqli_num_rows($result); } - static public function affectedRows($handler) + static public function affectedRows($handler, $result) { return mysqli_affected_rows($handler); } diff --git a/classes/Model.class.php b/classes/Model.class.php index eabd935..889e47c 100644 --- a/classes/Model.class.php +++ b/classes/Model.class.php @@ -61,9 +61,9 @@ abstract class Model return new ModelSelectResult($res); case 'insert': case 'replac': - return new ModelInsertResult($this->handler); + return new ModelInsertResult($this->handler, $res); //$res for postgreSQL default: - return new ModelChangeResult($this->handler); + return new ModelChangeResult($this->handler, $res); //$res for postgreSQL } } @@ -202,9 +202,9 @@ class ModelChangeResult extends ModelResult { public $affected; - function __construct($resource) + function __construct($resource, $result) { - $this->affected = DBConnector::affectedRows($resource); + $this->affected = DBConnector::affectedRows($resource, $result); } function count() @@ -217,9 +217,9 @@ class ModelInsertResult extends ModelChangeResult { public $id; - function __construct($resource) + function __construct($resource, $result) { - parent::__construct($resource); + parent::__construct($resource, $result); $this->id = DBConnector::getId($resource); } diff --git a/classes/pg_DBConnector.class.php b/classes/pg_DBConnector.class.php index 2550de9..68335f1 100644 --- a/classes/pg_DBConnector.class.php +++ b/classes/pg_DBConnector.class.php @@ -82,9 +82,9 @@ class DBConnector return pg_num_rows($result); } - static public function affectedRows($handler) + static public function affectedRows($handler, $result) { - return pg_affected_rows($handler); + return pg_affected_rows($result); } static public function getId($handler)