__construct()
__construct(string $wordSQL, callable $valueCallback, callable $IBLCallback, callback[] $prefixCallbacks)
A constructor.
A constructor.
Parameters
string | $wordSQL | A parameterized SQL boolean expression using placeholder(s) for each search word. |
callable | $valueCallback | A user function with a parameter to convert a search word. If omitted, no conversion will be processed. It would be given an original search word as the first parameter and must return a converted value, which if $thisobj were an instance of SQLBuilder, $thisobj->Build()['value'] would contain. The return value can be an array. |
callable | $IBLCallback | A user function with a parameter to convert a search word. If omitted, \SearchWordsSQL\IBLCallback() is used. It would be given an original search word as the first parameter and must return a converted value, which if $thisobj were an instance of SQLBuilder, $thisobj->Build()['IBL'] would contain. The return value can be an array. |
callback[] | $prefixCallbacks | An array containing prefix functions with keys to specify prefix. A prefix function will be called when a search word contains the prefix at the beginning. The prefix function must return an array containing an SQL string with key 'SQL' and an value with key 'value'. |