From: Tim Düsterhus Date: Tue, 8 Jun 2021 14:51:27 +0000 (+0200) Subject: Make MysqlSearchIndexManager implement set() X-Git-Tag: 5.5.0_Alpha_1~681^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b6662dba051386343b1400865c5ab7bb7f15783;p=GitHub%2FWoltLab%2FWCF.git Make MysqlSearchIndexManager implement set() The use of `add()` is deprecated. `set()` should be the canonical method. --- diff --git a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php index 110a5ede11..bf283f78bf 100644 --- a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php @@ -22,7 +22,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager /** * @inheritDoc */ - public function add( + public function set( $objectType, $objectID, $message, @@ -59,11 +59,44 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager $languageID = null, $metaData = '' ) { - // delete existing entry - $this->delete($objectType, [$objectID]); + $this->set( + $objectType, + $objectID, + $message, + $subject, + $time, + $userID, + $username, + $languageID, + $metaData + ); + } - // save new entry - $this->add($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData); + /** + * @inheritDoc + */ + public function add( + $objectType, + $objectID, + $message, + $subject, + $time, + $userID, + $username, + $languageID = null, + $metaData = '' + ) { + $this->set( + $objectType, + $objectID, + $message, + $subject, + $time, + $userID, + $username, + $languageID, + $metaData + ); } /**