diff options
author | Andrey Andreev <narf@devilix.net> | 2019-02-14 18:07:13 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2019-02-14 18:07:13 +0100 |
commit | 38291e8e44ca5ccc6273d310127db332ace8f84a (patch) | |
tree | 87d5a46a0746e9ed0bf8c6d9edb7c98cef12f10c /system/database/DB_query_builder.php | |
parent | 02cd9a097ea63593d3439ed89ddbfb0a19a2a7bd (diff) |
Close #4186, #5631, #5668
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 296a2eed5..eca9fb38b 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -717,7 +717,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function where_in($key = NULL, $values = NULL, $escape = NULL) + public function where_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_where', $key, $values, FALSE, 'AND ', $escape); } @@ -735,7 +735,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function or_where_in($key = NULL, $values = NULL, $escape = NULL) + public function or_where_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_where', $key, $values, FALSE, 'OR ', $escape); } @@ -753,7 +753,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function where_not_in($key = NULL, $values = NULL, $escape = NULL) + public function where_not_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_where', $key, $values, TRUE, 'AND ', $escape); } @@ -771,7 +771,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function or_where_not_in($key = NULL, $values = NULL, $escape = NULL) + public function or_where_not_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_where', $key, $values, TRUE, 'OR ', $escape); } @@ -789,7 +789,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function having_in($key = NULL, $values = NULL, $escape = NULL) + public function having_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_having', $key, $values, FALSE, 'AND ', $escape); } @@ -807,7 +807,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function or_having_in($key = NULL, $values = NULL, $escape = NULL) + public function or_having_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_having', $key, $values, FALSE, 'OR ', $escape); } @@ -825,7 +825,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function having_not_in($key = NULL, $values = NULL, $escape = NULL) + public function having_not_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_having', $key, $values, TRUE, 'AND ', $escape); } @@ -843,7 +843,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - public function or_having_not_in($key = NULL, $values = NULL, $escape = NULL) + public function or_having_not_in($key, array $values, $escape = NULL) { return $this->_wh_in('qb_having', $key, $values, TRUE, 'OR ', $escape); } @@ -870,20 +870,15 @@ abstract class CI_DB_query_builder extends CI_DB_driver { * @param bool $escape * @return CI_DB_query_builder */ - protected function _wh_in($qb_key, $key = NULL, $values = NULL, $not = FALSE, $type = 'AND ', $escape = NULL) + protected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL) { $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where'; - if ($key === NULL OR $values === NULL) + if ($key === NULL) { return $this; } - if ( ! is_array($values)) - { - $values = array($values); - } - is_bool($escape) OR $escape = $this->_protect_identifiers; $not = ($not) ? ' NOT' : ''; |