| @@ -16,10 +16,14 @@ | ||
| 16 | 16 | $this->table = 'tag'; |
| 17 | 17 | $this->pkey = 'id'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** | |
| 21 | + * Attaches the tags passed in parameter to the specified element | |
| 22 | + */ | |
| 20 | 23 | public function setTags(string $type, int $elementId, array $newTags): void |
| 21 | 24 | { |
| 25 | + // Remove the old tags from the element | |
| 22 | 26 | acym_query('DELETE FROM #__acym_tag WHERE `type` = '.acym_escapeDB($type).' AND `id_element` = '.intval($elementId)); |
| 23 | 27 | |
| 24 | 28 | $tagsToInsertQuery = []; |
| 25 | 29 | |