Cherry picked 05eb7aac8c8dfcb0ba40ef4aa5a8aca7c0ac2acb
hasField wrongly returns false if the field is inherited
DocumentRepository->findBy calls a new protected method contraintField to build the query
Added the alias as parameter in case it is changed in future versions
Fixed typo
Compliant to the coding standards