public static function updateRequesterSurveyStatus($ratee, $posting_id, $rater) { $q = RatersGroupTable::getInstance()->createQuery('rg'); $q->where('rg.ratee = ?', $ratee); $q->andWhere('rg.posting_id = ?', $posting_id); $rec = $q->execute(); $q = RatersGroupTable::getInstance()->findOneBy("id", $rec[0]->getId()); $q->setCounterDone(1); $q->save(); }
public static function saveResults($Data = array()) { $q = RatersGroupTable::getInstance()->createQuery('rg'); $q->where('rg.ratee = ?', $Data['ratee']); $q->andWhere('rg.posting_id = ?', $Data['posting_id']); $rec = $q->execute(); $survey = new SurveyResults(); $survey->setResult($Data['result']); $survey->setQuestionId($Data['question_id']); $survey->setRatersGroupId($rec[0]->getId()); $survey->setActionTimestamp(date('Y-m-d H:i:s')); $survey->save(); return $survey->getRatersGroupId(); }