LikeBuilder
class LikeBuilder (View source)
Constants
| DEFAULT_ANYCHARACTER_WILDCARD | 
                     The default wildcard that matches any number of characters in a LIKE query.  | 
            
| DEFAULT_ONECHARACTER_WILDCARD | 
                     The default wildcard that matches exactly one character in a LIKE query.  | 
            
| DEFAULT_ESCAPE_CHARACTER | 
                     The default character used to escape wildcards and other special characters.  | 
            
Properties
| protected string | $anyCharacterWildcard | The wildcard that matches any number of characters in a LIKE query.  | 
                |
| protected string | $oneCharacterWildcard | The wildcard that matches exactly one character in a LIKE query.  | 
                |
| protected string[] | $otherWildcards | Any other characters that may have a special meaning in a LIKE query.  | 
                |
| protected string | $escapeCharacter | The character used to escape wildcards and other special characters.  | 
                |
| protected array|null | $escapeMap | The string mapping used to escape special characters.  | 
                
Methods
Initialize the instance.
Get the wildcard that matches any number of characters in a LIKE query.
Get the wildcard that matches exactly one character in a LIKE query.
Get the string mapping used to escape special characters.
Escape a string to be safely used as a parameter for a LIKE query.
Split a string into words and format them to be used in LIKE queries.
Details
        
                            
    __construct($anyCharacterWildcard = self::DEFAULT_ANYCHARACTER_WILDCARD, $oneCharacterWildcard = self::DEFAULT_ONECHARACTER_WILDCARD, $escapeCharacter = self::DEFAULT_ESCAPE_CHARACTER, array $otherWildcards = [])
        
    
    Initialize the instance.
        
                            string
    getAnyCharacterWildcard()
        
    
    Get the wildcard that matches any number of characters in a LIKE query.
        
                            string
    getOneCharacterWildcard()
        
    
    Get the wildcard that matches exactly one character in a LIKE query.
        
                    protected        array
    getEscapeMap()
        
    
    Get the string mapping used to escape special characters.
        
                            string
    escapeForLike(string $string, bool $wildcardAtStart = true, bool $wildcardAtEnd = true)
        
    
    Escape a string to be safely used as a parameter for a LIKE query.
        
                            string[]|null
    splitKeywordsForLike(string|mixed $string, string $wordSeparators = '\\s', bool $addWildcards = true)
        
    
    Split a string into words and format them to be used in LIKE queries.