diff --git a/lbplanner/classes/model/user.php b/lbplanner/classes/model/user.php index 14aaa0d6..f6482f80 100644 --- a/lbplanner/classes/model/user.php +++ b/lbplanner/classes/model/user.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * Model for a course + * Model for a user * * @package local_lbplanner * @subpackage helpers @@ -36,7 +36,7 @@ use local_lbplanner\helpers\user_helper; /** - * Model class for course + * Model class for model */ class user { /** @@ -337,6 +337,7 @@ public static function api_structure_short(): external_single_structure { * @return array a full representation of this user and its data */ public function prepare_for_api(): array { + $mdluser = $this->get_mdluser(); return array_merge( $this->prepare_for_api_short(), [ @@ -346,6 +347,7 @@ public function prepare_for_api(): array { 'colorblindness' => $this->colorblindness, 'displaytaskcount' => $this->displaytaskcount, 'capabilities' => $this->get_capabilitybitmask(), + 'email' => $mdluser->email, ] ); } @@ -370,6 +372,7 @@ public static function api_structure(): external_single_structure { 'displaytaskcount' => new external_value(PARAM_INT, 'If the user has the taskcount-enabled 1-yes 0-no'), 'capabilities' => new external_value(PARAM_INT, 'The capabilities of the user represented as a bitmask value'), 'vintage' => new external_value(PARAM_TEXT, 'The vintage of the user', VALUE_DEFAULT), + 'email' => new external_value(PARAM_TEXT, 'The email address of the user'), ] ); }