Merge branch '6.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / search / AbstractSearchEngine.class.php
CommitLineData
b52f751b 1<?php
a9229942 2
b52f751b 3namespace wcf\system\search;
a9229942 4
71952a87 5use wcf\system\database\util\PreparedStatementConditionBuilder;
b52f751b
AE
6use wcf\system\SingletonFactory;
7
8/**
9 * Default implementation for search engines, this class should be extended by
10 * all search engines to preserve compatibility in case of interface changes.
a9229942
TD
11 *
12 * @author Alexander Ebert
13 * @copyright 2001-2019 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
b52f751b 15 */
a9229942
TD
16abstract class AbstractSearchEngine extends SingletonFactory implements ISearchEngine
17{
18 /**
19 * class name for preferred condition builder
20 * @var string
21 */
22 protected $conditionBuilderClassName = PreparedStatementConditionBuilder::class;
23
24 /**
25 * list of engine-specific special characters
26 * @var string[]
27 */
28 protected $specialCharacters = [];
29
30 /**
31 * @inheritDoc
32 */
33 public function getConditionBuilderClassName()
34 {
35 return $this->conditionBuilderClassName;
36 }
37
a9229942
TD
38 /**
39 * @inheritDoc
40 */
41 public function removeSpecialCharacters($string)
42 {
43 if (!empty($this->specialCharacters)) {
44 return \str_replace($this->specialCharacters, '', $string);
45 }
46
47 return $string;
48 }
0cd425be 49}