MDL-57273 core: Remove magic setters and getters
Remove the magic getters and setters from persistent. They are deprecated only in the persistent class for competencies.
This commit is contained in:
@@ -80,8 +80,8 @@ class course_module_competency extends persistent {
|
||||
* @return void
|
||||
*/
|
||||
protected function before_validate() {
|
||||
if (($this->get_id() && $this->get_sortorder() === null) || !$this->get_id()) {
|
||||
$this->set('sortorder', $this->count_records(array('cmid' => $this->get_cmid())));
|
||||
if (($this->get('id') && $this->get('sortorder') === null) || !$this->get('id')) {
|
||||
$this->set('sortorder', $this->count_records(array('cmid' => $this->get('cmid'))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class course_module_competency extends persistent {
|
||||
$instances = array();
|
||||
foreach ($results as $result) {
|
||||
$comp = new competency(0, $result);
|
||||
$instances[$comp->get_id()] = $comp;
|
||||
$instances[$comp->get('id')] = $comp;
|
||||
}
|
||||
$results->close();
|
||||
|
||||
@@ -268,7 +268,7 @@ class course_module_competency extends persistent {
|
||||
|
||||
$table = '{' . self::TABLE . '}';
|
||||
$sql = "UPDATE $table SET sortorder = sortorder -1 WHERE cmid = ? AND sortorder > ?";
|
||||
$DB->execute($sql, array($this->get_cmid(), $this->get_sortorder()));
|
||||
$DB->execute($sql, array($this->get('cmid'), $this->get('sortorder')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user