/** * Use store for this class and it's ancestors * @param $store an instance of qp_PollStore */ static function setStore( qp_PollStore $store ) { self::$store = $store; }
/** * Complete storage of user vote into DB. Final stage of successful poll POST. * When current poll wasn't previousely voted yet, it also creates poll structure * in DB */ function setUserVote() { if ( $this->hasQuestions() && $this->last_uid !== null && $this->mCompletedPostData === 'complete' ) { $this->interpretVote(); # warning: transaction should include minimal set of carefully monitored methods $db = wfGetDB( DB_MASTER ); $db->begin(); qp_PollCache::store( $db, 'qp_QuestionCache', 'qp_CategoryCache', 'qp_ProposalCache' ); if ( $this->interpResult->hasToBeStored() ) { $this->setAnswers( $db ); } $db->commit(); $this->voteDone = true; } }