Lev Semin
Lev Semin

Reputation: 263

Custom operator in Doctrine DQL

Good day. Please, tell me, how is it possible to create custom operator for Doctrine DQL?

I'm using Postgresql ltree extensions, which have many specific operators, such is @>, <@, ||, ~ and others. But I can't using it in my dql queries. Now, I have partially solved this problem by using native sql query, but I would like not use this method and add this operators to dql. Please, show me the way to solve this problem. There is no information about this in the official documentation and google.

Thank you. Sorry for bad english.

Upvotes: 2

Views: 1888

Answers (1)

Lev Semin
Lev Semin

Reputation: 263

Problem was solved by writing special DQL function. If it registred as ltree_operator, it can be used such ...WHERE ltree_operator(first_path, '@>', secont_path)=true... .

Upvotes: 5

Related Questions