Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
namespace mod_questionnaire\db;
18
 
19
/**
20
 * For bulk sql operations on useresponses.
21
 *
22
 * @package    mod_questionnaire
23
 * @copyright  2015 Guy Thomas <gthomas@moodlerooms.com>
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
class bulk_sql_config {
27
 
28
    /**
29
     * @var string $table
30
     */
31
    public $table = '';
32
 
33
    /**
34
     * @var string $tablealias
35
     */
36
    public $tablealias = '';
37
 
38
    /**
39
     * @var bool $usechoiceid
40
     */
41
    protected $usechoiceid = false;
42
 
43
    /**
44
     * @var bool $useresponse
45
     */
46
    protected $useresponse = false;
47
 
48
    /**
49
     * @var bool $userank
50
     */
51
    protected $userank = false;
52
 
53
    /**
54
     * The class constructor.
55
     * @param string $table
56
     * @param string $tablealias
57
     * @param bool $usechoiceid
58
     * @param bool $useresponse
59
     * @param bool $userank
60
     */
61
    public function __construct($table, $tablealias, $usechoiceid = false, $useresponse = false, $userank = false) {
62
        $this->table = $table;
63
        $this->tablealias = $tablealias;
64
        $this->usechoiceid = $usechoiceid;
65
        $this->useresponse = $useresponse;
66
        $this->userank = $userank;
67
    }
68
 
69
    /**
70
     * Fields that need to be included for extra select.
71
     * @return array
72
     */
73
    public function get_extra_select() {
74
        return [
75
            'choice_id' => $this->usechoiceid,
76
            'response' => $this->useresponse,
77
            'rankvalue' => $this->userank
78
        ];
79
    }
80
}