I'm using FOSUserBundle for Symfony2, and I need to be able to register a user without validating if the email is Unique, I just need a valid email so many users can have the same email ( I know this is weird, but I need it).
I have an entity "User" in a bundle that extends FOSUserBundle, is it possible to overwrite the column definition of emailCanonical to eliminate the unique parameter and remove the validation from the FormType?
I'm using Annotation for mapping my Entities and YML for validation of my forms.
The easiest way to "override" a bundle's routing is to never import it at all. Instead of importing a third-party bundle's routing, copy that routing file into your application, modify it, and import it instead.
A Symfony bundle is a collection of files and folders organized in a specific structure. The bundles are modeled in such a way that it can be reused in multiple applications. The main application itself is packaged as a bundle and it is generally called AppBundle.
I had a similar issue few weeks ago. The only solution is to extend model instead of entity:
use FOS\UserBundle\Model\User as BaseUser;
class User extends BaseUser
The downside is that you have to also copy everything from FOS User entity to your User entity. On the other hand, you can adjust the functionality to your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With