Best way to integrate user authentication in my bundle?

Discuss Symfony 2 bundles here

Moderators: tiagojsag, dcobalt

Best way to integrate user authentication in my bundle?

Postby 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

Return to Bundles discussion

Who is online

Users browsing this forum: No registered users and 4 guests