Removed usage of magic getter and abuse of $this->element
This commit is contained in:
parent
430ae35d71
commit
13f892a229
15 changed files with 293 additions and 94 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue