|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00018 00027 require_once($CFG->libdir.'/completion/data_object.php'); 00028 00032 class completion_aggregation extends data_object { 00033 00038 public $table = 'course_completion_aggr_methd'; 00039 00044 public $required_fields = array('id', 'course', 'criteriatype', 'method', 'value'); 00045 00051 public $course; 00052 00058 public $criteriatype; 00059 00065 public $method; 00066 00072 public $value; 00073 00074 00082 public static function fetch($params) { 00083 return self::fetch_helper('course_completion_aggr_methd', __CLASS__, $params); 00084 } 00085 00086 00094 public static function fetch_all($params) {} 00095 00102 public function setMethod($method) { 00103 $methods = array( 00104 COMPLETION_AGGREGATION_ALL, 00105 COMPLETION_AGGREGATION_ANY, 00106 ); 00107 00108 if (in_array($method, $methods)) { 00109 $this->method = $method; 00110 } else { 00111 $this->method = COMPLETION_AGGREGATION_ALL; 00112 } 00113 } 00114 }