MDL-32203 completion: Fix issues with data object where clauses
This commit is contained in:
committed by
Aaron Barnes
parent
aa753ac24f
commit
dbfcf440fa
@@ -49,13 +49,16 @@ class completion_aggregation extends data_object {
|
||||
*/
|
||||
public $required_fields = array('id', 'course', 'criteriatype', 'method', 'value');
|
||||
|
||||
/* @var array Array of unique fields, used in where clauses */
|
||||
public $unique_fields = array('course', 'criteriatype');
|
||||
|
||||
/* @var int Course id */
|
||||
public $course;
|
||||
|
||||
/* @var int Criteria type this aggregation method applies to, or NULL for overall course aggregation */
|
||||
public $criteriatype;
|
||||
|
||||
/* @var int Aggregation method (COMPLETION_AGGREGATION_* constant)*/
|
||||
/* @var int Aggregation method (COMPLETION_AGGREGATION_* constant) */
|
||||
public $method;
|
||||
|
||||
/* @var mixed Method value */
|
||||
@@ -98,4 +101,19 @@ class completion_aggregation extends data_object {
|
||||
$this->method = COMPLETION_AGGREGATION_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save aggregation method to database
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function save() {
|
||||
if ($this->id) {
|
||||
return $this->update();
|
||||
} else {
|
||||
return $this->insert();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user