columnize($sequence); } $sqlStr = 'select %s from new table (%s)'; $finalSql = sprintf($sqlStr, $sequenceStr, $sql); $results = $query->getConnection() ->select($finalSql, $values); if (is_array($sequence)) { return array_values((array) $results[0]); } else { $result = (array) $results[0]; if (isset($result[$sequenceStr])) { $id = $result[$sequenceStr]; } else { $id = $result[strtoupper($sequenceStr)]; } return is_numeric($id) ? (int) $id : $id; } } }