[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 b3bce3efa1
commit 6fc120571d
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -236,7 +236,7 @@ class Profile
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_to_add = array_diff($tags, $tag_existing);
@ -249,8 +249,5 @@ class Profile
foreach ($pt_to_remove as $pt) {
DB::remove($pt);
}
if ($flush) {
DB::flush();
}
}
}