I have a many to many table for User
and House
, called user_house
. Instead of just two columns: user_id and house_id, i want to add 3 more: eg action, created_at, updated_at. How can I do this?
I cannot find any relevant docs on this.
The following just creates a separate table with two columns in it.
class User extends EntityBase
{
...
/**
* @ORMManyToMany(targetEntity="AppBundleEntityHouse")
*/
protected $action;
Basically, what I want to achieve is:
in the user_house
table the combination of user_id
, house_id
, action
should be unique.
when a user clicks a "view" on a house, user_house table gets updated with some user_id
, some house_id
, view
, now()
, now()
when a user clicks a "like" on a house, user_house table gets updated with some user_id
, some house_id
, like
, now()
, now()
when a user clicks a "request a call" on a house, user_house table gets updated with some user_id
, some house_id
, contact
, now()
, now()
Could someone point me in the right direction? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…