Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the simplest way to change PhqlQueryParser::OPERATOR_IS_LIKE from 'LIKE' to 'ILIKE' ? #23

Open
szonov opened this issue Dec 23, 2016 · 3 comments

Comments

@szonov
Copy link

szonov commented Dec 23, 2016

No description provided.

@andevsoftware
Copy link
Contributor

@szonov, can you explain what you mean by that?

@szonov
Copy link
Author

szonov commented Dec 23, 2016

Hello,
I use postgresql as database, LIKE in postgres is case sensitive, in my api search criteria should be be case insensitive. For it in postgres there is ILIKE operator.. I'm looking way to change behaviour, and use in resulting search queries ILIKE instead of LIKE without changing your code.

@szonov
Copy link
Author

szonov commented Dec 23, 2016

I thought about extending PhqlQueryParser class, but now it does not work. functions getOperator() and operatorMap() are private - can not change it in extended class. I can redefine const OPERATOR_IS_LIKE in my extended class - but in operatorMap() it is used as self::OPERATOR_IS_LIKE. Maybe you can replace in function operatorMap() usage self::OPERATOR_* to static::OPERATOR_*? It give me possibility to fix my issue by:

class myPhqlQueryParser extends PhqlQueryParser {
const OPERATOR_IS_LIKE = 'ILIKE';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants