Skip to content

PHPMentorsValidatorBundle 1.2.0 (stable)

Compare
Choose a tag to compare
@iteman iteman released this 27 Apr 07:14
· 13 commits to master since this release
v1.2.0

Release Date: 2015-04-27 UTC

What's New in PHPMentorsValidatorBundle 1.2.0

Range constraint

(@iteman, Issue #11)

The Range constraint allows you to use a custom factory to provide the value of min or max options as the following:

src/AppBundle/Resources/config/validation.yml:

AppBundle\Entity\Person:
    properties:
        ...
        birthday:
            ...
            - PHPMentors:Range:
                max:
                    service: app.age_range
                    method: getMinAsDate
                maxMessage: ...
                min:
                    service: app.age_range
                    method: getMaxAsDate
                minMessage: ...