Can Laminas manage the ilike operator?

Hello everyone,

I’m working on Laminas with a postgresql database. I noticed in the Laminas packages that operators such as between, like, etc. could be managed.
Except that I can’t find anything on the ilike specific to postgresql. Are there any plans to manage the ilike in the future?
If so, do you know roughly when this will happen?
If not, are there any other alternatives?

Thank you in advance for your time and feedback!

Hey @laureuh ,

I don 't think that this will be done in the future. Actually you can even do it with the LIKE expression that is already shipped with laminas-db. You can change the specification from '%1$s LIKE %2$s' tp '%1$s ILIKE %2$s'.

Something like this …

$select = new Select();
$select->where->addPredicate(
    (new Like('column', 'value%'))->setSpecification('%1$s ILIKE %2$s')
);

If you want to call it that, it’s already implemented. Somehow …

1 Like

Hello and welcome to our forums! :smiley:

No, because ILIKE is a PostgreSQL extension and not in the SQL standard.

You can use an expression:

$select->where->expression('field ILIKE ?', $value);
2 Likes

wow! thank you so much for your quick replies!
I’ve tried these solutions and they work really well.
thanks again for your advice!