From 56542f9f05c95616e1c94a7453e8c9b8ed5b47e2 Mon Sep 17 00:00:00 2001 From: Nenad Ticaric Date: Fri, 14 Jul 2023 14:24:34 +0200 Subject: [PATCH] getters and setters --- src/Engines/EngineTrait.php | 5 ++++ src/TNTSearch.php | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/src/Engines/EngineTrait.php b/src/Engines/EngineTrait.php index 181584e..c12e1c7 100644 --- a/src/Engines/EngineTrait.php +++ b/src/Engines/EngineTrait.php @@ -168,4 +168,9 @@ public function setLanguage($language = 'no') $class = 'TeamTNT\\TNTSearch\\Stemmer\\' . ucfirst(strtolower($language)) . 'Stemmer'; $this->setStemmer(new $class); } + + public function setDatabaseHandle($dbh) + { + $this->dbh = $dbh; + } } diff --git a/src/TNTSearch.php b/src/TNTSearch.php index 9fee84d..86f5e6e 100644 --- a/src/TNTSearch.php +++ b/src/TNTSearch.php @@ -435,4 +435,63 @@ public function fuzzyNoLimit($value) { $this->engine->fuzzy_no_limit = $value; } + + public function setFuzziness($value) + { + $this->engine->fuzziness = $value; + } + + public function setFuzzyDistance($value) + { + $this->engine->fuzzy_distance = $value; + } + + public function setFuzzyPrefixLength($value) + { + $this->engine->fuzzy_prefix_length = $value; + } + + public function setFuzzyMaxExpansions($value) + { + $this->engine->fuzzy_max_expansions = $value; + } + + public function setFuzzyNoLimit($value) + { + $this->engine->fuzzy_no_limit = $value; + } + public function setAsYouType($value) + { + $this->engine->asYouType = $value; + } + + public function getFuzziness() + { + return $this->engine->fuzziness; + } + + public function getFuzzyDistance() + { + return $this->engine->fuzzy_distance; + } + + public function getFuzzyPrefixLength() + { + return $this->engine->fuzzy_prefix_length; + } + + public function getFuzzyMaxExpansions() + { + return $this->engine->fuzzy_max_expansions; + } + public function getFuzzyNoLimit() + { + return $this->engine->fuzzy_no_limit; + } + + public function getAsYouType() + { + return $this->engine->asYouType; + } + }