From 6fc120571d97f52a4c4288c21319e53eeaf279b4 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 27 Jul 2020 03:46:51 +0000 Subject: [PATCH] [DATABASE] Remove DATABASE::flush from Profile::setSelfTags --- src/Entity/Profile.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Entity/Profile.php b/src/Entity/Profile.php index d498780e29..2a2f40e764 100644 --- a/src/Entity/Profile.php +++ b/src/Entity/Profile.php @@ -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(); - } } }