/** * Generate WHERE clause from user-supplied string or array * * @param string|array $where OPTIONAL An SQL WHERE clause. * @return TableSelect */ protected static function _where(TableSelect $select, $where) { $where = (array) $where; foreach ($where as $key => $val) { // is $key an int? if (is_int($key)) { // $val is the full condition $select->where($val); } else { // $key is the condition with placeholder, // and $val is quoted into the condition $select->where($key, $val); } } return $select; }