public function cache($qubaids) {
        global $DB;
        $toinsert = new \stdClass();
        $toinsert->hashcode = $qubaids->get_hash_code();
        $toinsert->timemodified = time();
        foreach ($this->fieldsindb as $field) {
            $toinsert->{$field} = $this->{$field};
        }
        $DB->insert_record('question_statistics', $toinsert, false);

        if ($this->get_variants()) {
            foreach ($this->variantstats as $variantstat) {
                $variantstat->cache($qubaids);
            }
        }
    }
public function cache($qubaids) {
        global $DB;
        $toinsert = new \stdClass();
        $toinsert->hashcode = $qubaids->get_hash_code();
        $toinsert->timemodified = time();
        foreach ($this->fieldsindb as $field) {
            $toinsert->{$field} = $this->{$field};
        }
        $DB->insert_record('question_statistics', $toinsert, false);

        if ($this->get_variants()) {
            foreach ($this->variantstats as $variantstat) {
                $variantstat->cache($qubaids);
            }
        }
    }
public function cache ( $ qubaids ) { global $ DB ; $ toinsert = new \ stdClass ( ) ; $ toinsert -> hashcode = $ qubaids -> get_hash_code ( ) ; $ toinsert -> timemodified = time ( ) ; foreach ( $ this -> fieldsindb as $ field ) { $ toinsert -> { $ field } = $ this -> { $ field } ; } $ DB -> insert_record ( 'question_statistics' , $ toinsert , false ) ; if ( $ this -> get_variants ( ) ) { foreach ( $ this -> variantstats as $ variantstat ) { $ variantstat -> cache ( $ qubaids ) ; } } }
Cache calculated stats stored in this object in 'question_statistics' table.

@param \qubaid_condition $qubaids
Cache calculated stats stored in this object in question_statistics table .