Code Standard + renaming deleteAllTags + move its call and add type param

This commit is contained in:
Jonny Tischbein 2018-10-23 19:29:59 +02:00
parent 26ed71cc14
commit e022bac339
5 changed files with 25 additions and 31 deletions

View file

@ -896,14 +896,9 @@ class Item extends BaseObject
}
if (!is_null($tags)) {
if ($tags) {
Term::insertFromTagFieldByItemId($item['id'], $tags);
if (!empty($item['tag'])) {
DBA::update('item', ['tag' => ''], ['id' => $item['id']]);
}
}
else {
Term::deleteAllTags($item['id']);
Term::insertFromTagFieldByItemId($item['id'], $tags);
if (!empty($item['tag'])) {
DBA::update('item', ['tag' => ''], ['id' => $item['id']]);
}
}