aboutsummaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-01-07 07:33:17 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-01-07 07:33:17 +0000
commitcede27e88662ff32895e2eacca25a6a8ed0ddb5b (patch)
tree75236b2a67ed17223b98d9442da117f5e9719dbb /lib/models
parent3f455264b9a89b3122feedd31aa7b26f6d61ef24 (diff)
fix oer tags editting, fixes #5094
Closes #5094 Merge request studip/studip!3812
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/OERMaterial.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/models/OERMaterial.php b/lib/models/OERMaterial.php
index 604f845..83ca8e2 100644
--- a/lib/models/OERMaterial.php
+++ b/lib/models/OERMaterial.php
@@ -237,15 +237,12 @@ class OERMaterial extends SimpleORMap
public function getTopics()
{
- $statement = DBManager::get()->prepare("
- SELECT oer_tags.*
- FROM oer_tags
- INNER JOIN oer_tags_material ON (oer_tags_material.tag_hash = oer_tags.tag_hash)
- WHERE oer_tags_material.material_id = :material_id
- ORDER BY oer_tags.name ASC
- ");
- $statement->execute(['material_id' => $this->getId()]);
- return $statement->fetchAll(PDO::FETCH_ASSOC);
+ $query = "SELECT oer_tags.*
+ FROM oer_tags
+ JOIN oer_tags_material USING (tag_hash)
+ WHERE oer_tags_material.material_id = :material_id
+ ORDER BY oer_tags.name ASC";
+ return DBManager::get()->fetchAll($query, [':material_id' => $this->id]);
}
public function setTopics($tags)