public function setQuery($query = null)
    {

        try {

            // need to return << true
            $this->validator->verify($query, ['isNotNull', 'isAcceptLength']);

            if (false === $this->exact) {
                $this->query = ['query' => '%' . $query . '%'];
            }
            else {
                $this->query = ['query' => $query];
            }

        }
        catch(ExceptionFactory $e) {
            echo $e->getMessage();
        }

        return $this;
    }
public function setQuery($query = null)
    {

        try {

            // need to return << true
            $this->validator->verify($query, ['isNotNull', 'isAcceptLength']);

            if (false === $this->exact) {
                $this->query = ['query' => '%' . $query . '%'];
            }
            else {
                $this->query = ['query' => $query];
            }

        }
        catch(ExceptionFactory $e) {
            echo $e->getMessage();
        }

        return $this;
    }
public function setQuery ( $ query = null ) { try { // need to return << true $ this -> validator -> verify ( $ query , [ 'isNotNull' , 'isAcceptLength' ] ) ; if ( false === $ this -> exact ) { $ this -> query = [ 'query' => '%' . $ query . '%' ] ; } else { $ this -> query = [ 'query' => $ query ] ; } } catch ( ExceptionFactory $ e ) { echo $ e -> getMessage ( ) ; } return $ this ; }
Prepare query value

@param  string|null      $query
@example <code>
$s->setQuery('what i want to find')
</code>
@throws ExceptionFactory {$error}
@return Searcher
Prepare query value