New issue
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
Implement new validation report query API #1022
Comments
(In 69c38a7aa87c1aefaa771eb127e5b4b93e11d269) branching off 1.0 for working on a new validation report query API, refs #1022 |
(In 0129cfe2613f7495a9aa3a6e92e3a5363f870a70) initial work based on a patch by dominik, refs #1022 |
Attachment: Quick and dirty sample app mods to use this API https://github.com/agavi/trac-ticket-attachments/blob/master/1022/1022-test.patch (2.5 kB) |
(In 51d255a57c0cecd26da83a17daf49148ec677608) add not processes arguments to the argumentresults instead of ignoring them |
(In 1af57c115b62f71100bfc7686d1e710d30dbfdcc) |
(In 922c6b35efb7cae5beb67bc806f0902ceccc45c9) Removed [AgaviValidationArgumentResult](http://github.com/agavi/agavi/wiki/AgaviValidationArgumentResult) and [AgaviValidationValidatorResult](http://github.com/agavi/agavi/wiki/AgaviValidationValidatorResult) and associated APIs. |
Title changed from “Introduce new validation report query API” to “Implement new validation report query API” |
(In 388d1bc42428c23823fdf4a1689db1ac7026be3b) changelog and release notes for this awesomeness, refs #1022 |
(In 06416af3a7fc24f7a4299d38dea2f43079b5b649) merging in validation-report-query branch, closes #1022 and #1030. Check it out, folks! |
Issue closed |
(In c426a6f78bc33d1ae152b17129177da8fc3b1f13) added AgaviIValidationReportQuery::byMaxSeverity(), cleaned up the docs and fixed an issue with minSeverity filter checks in [AgaviValidationReportQuery](http://github.com/agavi/agavi/wiki/AgaviValidationReportQuery)::getResult(), refs #1022 |
These need to go, because Dominik had a much better idea this week :)
A new API for convenient querying of indicents, errors and result codes.
Examples of sweetness:
``` php
<?php
$report = $this→getContainer()→getReport();
// or $report = $this→getContainer()→getReport()→createQuery();
$nameValid = !$report→byArgument(‘name’)→has();
// every by() method returns a clone of the query object, so we do not have to make new instances here
$nameMissing = $report→byArgument(‘name’)→byErrorName(‘required’)→has();
$myoptionalfileIsImage = $report→byArgument(new AgaviValidationArgument(‘myoptionalfile’, AgaviWebRequestDataHolder::SOURCE_FILES))→byValidator(‘is_image’)→getResult() === AgaviValidator::SUCCESS;
```
The text was updated successfully, but these errors were encountered: