zendframework/zf2 — pull request #4059 by zburnham (2013-03-18 02:56:31+00:00)
Title: Ability to further validate empty fields with InputFilter

Currently a field is immediately marked as valid or invalid based on the empty/non-empty content of the field and the settings of the 'allowEmpty' and/or 'required' flags on an Input. This PR adds the ability to allow for further context-based validation of an empty field. For example, say you have 3 fields, firstName, lastName, and businessName. You have a fourth field, 'residential', that is either Y or N. If 'residential' is 'Y', then firstName and lastName must be non-empty. If 'residential' is N, then 'businessName' must be non-empty. In this case, all fields are required, but some may be empty. The introduction of a 'continueIfEmpty' property on an Input is proposed, with concomitant changes to the BaseInputFilter and Factory classes.