use the correct class name to retrieve mapped class' metadata and repository
bug #9647 use the correct class name to retrieve mapped class' metadata and reposi... (xabbuh)

This PR was merged into the 2.2 branch.

Discussion
----------

use the correct class name to retrieve mapped class' metadata and reposi...

...tory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9646
| License       | MIT
| Doc PR        |

The validation context isn't necessarily the entity being validated. In case that you added the Unique Entity constraint inside your custom type via the ``constraints`` option the validation context will be the ``Form`` class itself. Thus, not the validation context should be used to get the class metadata and the repository of the validated entity, but the entity itself should be used.

Commits
-------

cd4df11 use the correct class name to retrieve mapped class' metadata and repository