private function fillForm(Form $form, User $user) { $form['username']->setDefaultValue($user->getUsername()); $form['email']->setDefaultValue($user->getEmail()); $form['first_name']->setDefaultValue($user->getFirstName()); $form['last_name']->setDefaultValue($user->getLastName()); foreach ($user->getRoles() as $roleID => $role) { // todo $form['role']->setDefaultValue($roleID); } }