This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Best way to integrate user authentication in my bundle?

Discuss Symfony 2 bundles here

Best way to integrate user authentication in my bundle?

by amitayh » Thu Mar 08, 2012 12:04 pm

Hi,
I want to create entities in my bundle the are linked to users (for example - forum posts)
I'm not sure how to reference the user since different applications can use different user providers (for example - FOSUserBundle, or some other...)
At the moment all I need from the user is roles, and username.

What's the best way to achieve this?

Code: Select all
/**
 * @ManyToOne(targetEntity="???")
 * @JoinColumn(name="user_id", referencedColumnName="id")
 */
private $user;


Thanks in advance for your help!
amitayh
Junior Member
 
Posts: 1
Joined: Thu Mar 08, 2012 11:53 am