We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, Code visibility is good if Query Builder is more Declarative.
add when()method to contain condition statements. nests and if statements are less.
when()
when()method has follow arguments
before
// switch null clause if ($label === null) { $queryBuilder->where(`label is :label`) ->setParameter( 'label', $label); }else { $queryBuilder->where(`label = :label`) ->setParameter( 'label', $label); } // conditional clause if (!$isAdmin) { $queryBuilder->addWhere('isPublic = true'); }
after
$queryBuilder->when( condition: $label === null, truthy: fn ($queryBuilder) => $queryBuilder->where(`label is :label`), falsy: fn ($queryBuilder) => $queryBuilder->where(`label = :label`) ) ->setParameter( 'label', $label) ->when(!$isAdmin, fn ($queryBuilder) => $queryBuilder->addWhere('isPublic = true')) ;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Feature Request
Hello,
Code visibility is good if Query Builder is more Declarative.
Summary
add
when()
method to contain condition statements.nests and if statements are less.
when()
method has follow argumentsbefore
after
The text was updated successfully, but these errors were encountered: