0

I've got form containing 2 entities:

-A
-B

Entity A got field country. Entity B got special special field let's call it x. I want to do a conditional validation. If field country in A entity got specific value then x field from entity B should be validated else validation should be skipped.

 <class name="A">

        <property name="country">
            <constraint name="Country>
                <option name="message">pso.country.incorrect</option>
            </constraint>
        </property>

    </class>


  <class name="B">

    <property name="x">
        <constraint name="X">
            <option name="message">pso.x.incorrect</option>
        </constraint>
    </property>

</class>

Is it possible to pass result of A-class country field validator to B-class x field validator?

user2739610
  • 11
  • 1
  • 6

1 Answers1

0

Maybe you can read this part of the documentation :)

Pierre
  • 776
  • 6
  • 27
  • Ok, I'm trying to do sth like this http://stackoverflow.com/questions/17104501/skip-validation-if-sibling-checkbox-field-contains-false the second answer but it is not working correctly. – user2739610 Dec 01 '13 at 20:24
  • It is based on fos_user_bundle. In config.yml I've got validation_groups: [ Default, Registration, PlatformRegistration ] and In for setDefault validation_groups I'm trying to do sth from the link above. – user2739610 Dec 01 '13 at 20:37