From 6c147f2ea54d58376f95998312c12531a027a402 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 7 Sep 2017 20:45:21 +0200 Subject: [PATCH] Connection, dibi: deprecated insertId() & affectedRows() --- src/Dibi/Connection.php | 11 ++++------- src/Dibi/dibi.php | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Dibi/Connection.php b/src/Dibi/Connection.php index c37875e4..b5531b18 100644 --- a/src/Dibi/Connection.php +++ b/src/Dibi/Connection.php @@ -342,12 +342,11 @@ class Connection /** - * Gets the number of affected rows. Alias for getAffectedRows(). - * @return int number of rows - * @throws Exception + * @deprecated */ public function affectedRows() { + trigger_error(__METHOD__ . '() is deprecated, use getAffectedRows()', E_USER_DEPRECATED); return $this->getAffectedRows(); } @@ -370,13 +369,11 @@ class Connection /** - * Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId(). - * @param string optional sequence name - * @return int - * @throws Exception + * @deprecated */ public function insertId($sequence = null) { + trigger_error(__METHOD__ . '() is deprecated, use getInsertId()', E_USER_DEPRECATED); return $this->getInsertId($sequence); } diff --git a/src/Dibi/dibi.php b/src/Dibi/dibi.php index 46945d22..0379da7f 100644 --- a/src/Dibi/dibi.php +++ b/src/Dibi/dibi.php @@ -277,12 +277,11 @@ class dibi /** - * Gets the number of affected rows. Alias for getAffectedRows(). - * @return int number of rows - * @throws Dibi\Exception + * @deprecated */ public static function affectedRows() { + trigger_error(__METHOD__ . '() is deprecated, use getAffectedRows()', E_USER_DEPRECATED); return self::getConnection()->getAffectedRows(); } @@ -301,13 +300,11 @@ class dibi /** - * Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId(). - * @param string optional sequence name - * @return int - * @throws Dibi\Exception + * @deprecated */ public static function insertId($sequence = null) { + trigger_error(__METHOD__ . '() is deprecated, use getInsertId()', E_USER_DEPRECATED); return self::getConnection()->getInsertId($sequence); }