Skip to content

Commit

Permalink
Fixed issue 17485: The getAnswerQuery method cannot be used in the An…
Browse files Browse the repository at this point in the history
…swers model (#2569)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Aug 18, 2022
1 parent 5ea1cee commit bca4134
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/models/Answer.php
Expand Up @@ -207,6 +207,7 @@ public static function updateSortOrder($qid, $lang)
* @param string $lang
* @param bool $return_query
* @return array|CDbCommand
* @deprecated
*/
public function getAnswerQuery($surveyid, $lang, $return_query = true)
{
Expand All @@ -215,8 +216,8 @@ public function getAnswerQuery($surveyid, $lang, $return_query = true)
$query->from("{{answers}}, {{questions}}");
$query->where("{{questions}}.sid = :surveyid AND {{questions}}.qid = {{answers}}.qid AND {{questions}}.language = {{answers}}.language AND {{questions}}.language = :lang");
$query->order('qid, code, sortorder');
$query->bindParams(":surveyid", $surveyid, PDO::PARAM_INT);
$query->bindParams(":lang", $lang, PDO::PARAM_STR);
$query->bindParam(":surveyid", $surveyid, PDO::PARAM_INT);
$query->bindParam(":lang", $lang, PDO::PARAM_STR);
return ($return_query) ? $query->queryAll() : $query;
}

Expand Down

0 comments on commit bca4134

Please sign in to comment.