Removed usage of magic getter and abuse of $this->element

This commit is contained in:
Mark Nelson 2017-08-26 13:39:47 +08:00
parent 430ae35d71
commit 13f892a229
15 changed files with 293 additions and 94 deletions

View file

@ -49,7 +49,7 @@ class element extends \mod_customcert\element {
$code = \mod_customcert\certificate::generate_code();
} else {
// Get the page.
$page = $DB->get_record('customcert_pages', array('id' => $this->element->pageid), '*', MUST_EXIST);
$page = $DB->get_record('customcert_pages', array('id' => $this->get_pageid()), '*', MUST_EXIST);
// Get the customcert this page belongs to.
$customcert = $DB->get_record('customcert', array('templateid' => $page->templateid), '*', MUST_EXIST);
// Now we can get the issue for this user.