[PR #1150] Improve Comparison::CONTAINS: allow to use custom position for % and _ wildcard characters #9207

Closed
opened 2026-01-22 16:03:35 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/1150

State: closed
Merged: No


This pull prevent forced wrapping of the value in to %
and allow to use the custom position for % and _ wildcard characters in case Comparison::CONTAINS

Allow to build the contains expressions like:

Criteria::expr()->contains('myField', 'some string%');
Criteria::expr()->contains('myField', '%some string');
Criteria::expr()->contains('myField', '%10\%'); // search for 10% at end of the string
Criteria::expr()->contains('myField', 's_m_ string');
**Original Pull Request:** https://github.com/doctrine/orm/pull/1150 **State:** closed **Merged:** No --- This pull prevent forced wrapping of the value in to `%` and allow to use the custom position for `%` and `_` wildcard characters in case `Comparison::CONTAINS` Allow to build the `contains` expressions like: ``` php Criteria::expr()->contains('myField', 'some string%'); Criteria::expr()->contains('myField', '%some string'); Criteria::expr()->contains('myField', '%10\%'); // search for 10% at end of the string Criteria::expr()->contains('myField', 's_m_ string'); ```
admin added the pull-request label 2026-01-22 16:03:35 +01:00
admin closed this issue 2026-01-22 16:03:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9207