Skip to content

Convert condition operators to predicate functions for CakePHP 6 - #413

Open
josbeir wants to merge 3 commits into
6.xfrom
feature/function-predicates
Open

josbeir wants to merge 3 commits into
6.xfrom
feature/function-predicates

Conversation

@josbeir

@josbeir josbeir commented Oct 24, 2026 •

Copy link
Copy Markdown

Add a cakephp60 conversion rule for the predicate API introduced in cakephp/cakephp#19736.

Before:

$query->where([
    'id >' => $minimum,
    'title LIKE' => $pattern,
]);

After:

use function Cake\Database\Expression\{greaterThan, like};

$query->where([
    'id' => greaterThan($minimum),
    'title' => like($pattern),
]);

Preserve nullable IS comparisons, nested boolean groups, repeated field conditions, and binding types. Reuse existing imports and aliases, group predicate imports, and leave ambiguous arrays unchanged for manual migration.

Handle extra whitespace around operators and between the words of multiword operators, while preserving field expressions.

@ADmad

ADmad commented Oct 24, 2026

Copy link
Copy Markdown
Member

Are keys with extra which space around the operators ('foo > ') considered?

@josbeir

josbeir commented Oct 24, 2026 •

Copy link
Copy Markdown
Author

Are keys with extra which space around the operators ('foo > ') considered?

Yep but but in between words like IS NULL
I'll fix that

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

Successfully merging this pull request may close these issues.

2 participants