aboutsummaryrefslogtreecommitdiff
path: root/lib/models/LtiGrade.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:07:19 +0200
committerJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:19:12 +0200
commita3da1483a9e689846179159355badfec8073dbec (patch)
tree770dcca6bdf5f6f2a11b0e7fcbbeda6919a3fc52 /lib/models/LtiGrade.php
current code from svn, revision 62608
Diffstat (limited to 'lib/models/LtiGrade.php')
-rw-r--r--lib/models/LtiGrade.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/models/LtiGrade.php b/lib/models/LtiGrade.php
new file mode 100644
index 0000000..43fdc9a
--- /dev/null
+++ b/lib/models/LtiGrade.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * LtiGrade.php - LTI consumer API for Stud.IP
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * @author Elmar Ludwig
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
+ */
+
+class LtiGrade extends SimpleORMap
+{
+ /**
+ * Configure the database mapping.
+ */
+ protected static function configure($config = [])
+ {
+ $config['db_table'] = 'lti_grade';
+
+ $config['belongs_to']['link'] = [
+ 'class_name' => LtiData::class,
+ 'foreign_key' => 'link_id'
+ ];
+ $config['belongs_to']['user'] = [
+ 'class_name' => User::class,
+ 'foreign_key' => 'user_id'
+ ];
+
+ parent::configure($config);
+ }
+}