Fixed doctrine entity validation errors, codestyle fixes (cherry picked from commit 0cdbc78)

Fixed doctrine entity validation errors, codestyle fixes
(cherry picked from commit 0cdbc78)