diff options
Diffstat (limited to 'lib/models/Courseware/BlockComment.php')
| -rw-r--r-- | lib/models/Courseware/BlockComment.php | 19 |
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); + } + } } |
