Skip to content

Commit

Permalink
Dev: revert 05cd63d
Browse files Browse the repository at this point in the history
Dev: revert 49772b7
Dev: else  CDbDataReader cannot rewind. It is a forward-only reader.
  • Loading branch information
Shnoulle committed Dec 22, 2012
1 parent 05cd63d commit 5629add
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions application/models/Answers.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,7 @@ function getAnswers($qid)
*/
function getAnswerFromCode($qid, $code, $lang, $iScaleID=0)
{
static $answerCache = array();

if (array_key_exists($qid, $answerCache)
&& array_key_exists($code, $answerCache[$qid])
&& array_key_exists($lang, $answerCache[$qid][$code])
&& array_key_exists($iScaleID, $answerCache[$qid][$code][$lang])) {
// We have a hit :)
return $answerCache[$qid][$code][$lang][$iScaleID];
} else {
$answerCache[$qid][$code][$lang][$iScaleID] = Yii::app()->db->cache(6)->createCommand()
return Yii::app()->db->cache(6)->createCommand()
->select('answer')
->from(self::tableName())
->where(array('and', 'qid=:qid', 'code=:code', 'scale_id=:scale_id', 'language=:lang'))
Expand All @@ -108,9 +99,6 @@ function getAnswerFromCode($qid, $code, $lang, $iScaleID=0)
->bindParam(":lang", $lang, PDO::PARAM_STR)
->bindParam(":scale_id", $iScaleID, PDO::PARAM_INT)
->query();

return $answerCache[$qid][$code][$lang][$iScaleID];
}
}

public function oldNewInsertansTags($newsid,$oldsid)
Expand Down

0 comments on commit 5629add

Please sign in to comment.