Ticket #1022 (closed enhancement: fixed)
Implement new validation report query API
| Reported by: | david | Owned by: | david |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | validation | Version: | 1.0.0beta8 |
| Severity: | normal | Keywords: | |
| Cc: | Patch attached: | no |
Description (last modified by david) (diff)
#785 introduced a couple of refactorings to the validation system, and also new API parts for getting results out of the validation system, most notably via the new classes AgaviValidationArgumentResult and AgaviValidationValidatorResult.
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 $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;
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


