[DATABASE] Remove DATABASE::flush from Profile::setSelfTags

This commit is contained in:
Hugo Sales 2020-07-27 03:46:51 +00:00 committed by Hugo Sales
parent 34890aff90
commit 9dffd1c93e
1 changed files with 1 additions and 4 deletions

View File

@ -236,7 +236,7 @@ class Profile
return DB::findBy('profile_tag', ['tagger' => $this->id, 'tagged' => $this->id]); return DB::findBy('profile_tag', ['tagger' => $this->id, 'tagged' => $this->id]);
} }
public function setSelfTags(array $tags, array $pt_existing, bool $flush = true): void public function setSelfTags(array $tags, array $pt_existing): void
{ {
$tag_existing = F\map($pt_existing, function ($pt) { return $pt->getTag(); }); $tag_existing = F\map($pt_existing, function ($pt) { return $pt->getTag(); });
$tag_to_add = array_diff($tags, $tag_existing); $tag_to_add = array_diff($tags, $tag_existing);
@ -249,8 +249,5 @@ class Profile
foreach ($pt_to_remove as $pt) { foreach ($pt_to_remove as $pt) {
DB::remove($pt); DB::remove($pt);
} }
if ($flush) {
DB::flush();
}
} }
} }