aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/BlockComment.php
diff options
context:
space:
mode:
authorRon Lucke <lucke@elan-ev.de>2023-05-26 08:58:15 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-05-26 08:58:15 +0000
commitcf961f344e929ff56d8f98154b6de2601355bf16 (patch)
tree8f41cad6467b41dd14a4ca87a1683f46ec54a5ff /lib/models/Courseware/BlockComment.php
parent04ad36e3a9845a401d95d35880deda5ea390e9dd (diff)
fix #797
Closes #797 Merge request studip/studip!1814
Diffstat (limited to 'lib/models/Courseware/BlockComment.php')
-rw-r--r--lib/models/Courseware/BlockComment.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/models/Courseware/BlockComment.php b/lib/models/Courseware/BlockComment.php
index 16f3a73..fc68111 100644
--- a/lib/models/Courseware/BlockComment.php
+++ b/lib/models/Courseware/BlockComment.php
@@ -23,7 +23,7 @@ use User;
* @property \User $user belongs_to User
* @property \Courseware\Block $block belongs_to Courseware\Block
*/
-class BlockComment extends \SimpleORMap
+class BlockComment extends \SimpleORMap implements \PrivacyObject
{
protected static function configure($config = [])
{
@@ -57,4 +57,21 @@ class BlockComment extends \SimpleORMap
return StructuralElement::build($structuralElement, false);
}
+
+ /**
+ * Export available data of a given user into a storage object
+ * (an instance of the StoredUserData class) for that user.
+ *
+ * @param StoredUserData $storage object to store data into
+ */
+ public static function exportUserData(\StoredUserData $storage)
+ {
+ $comments = \DBManager::get()->fetchAll(
+ 'SELECT * FROM cw_block_comments WHERE user_id = ?',
+ [$storage->user_id]
+ );
+ if ($comments) {
+ $storage->addTabularData(_('Courseware Block Kommentare'), 'cw_block_comments', $comments);
+ }
+ }
}