17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 689 Views |
-
Datarelations Member - Event

13 December 2008 at 4:19am Last edited: 13 December 2008 4:19am
I've a problem with datarelations.
On my page I've some Events that each Member can sing up to. The problem is that the member has to be able to choose what to drink and eat for each Event. I've tried to solve it using an extra dataobject called Participant like this
EventPage
many_many: ParticipantParticipant
Has_many: EventPage
Has_one: MemberMember
has_one: ParticipantEach member can sing up to the event through a form on the event-page.
The problem is that I dont know how to save the information in the correct way.File: EventPage
$p = new Participant();
if(isset($data['toDrink'])) {
$p->Drink = $data['toDrink'];
}
if(isset($data['Vegetarian'])) {
$p->Vegetarian = $data['Vegetarian'];
}
$p->Member = Member::CurrentUser();
$e = $p->Events();
$e->add($this);
$p->write();
$existingParticipants = $this->Participants();
$existingParticipants->add($p);The fields
- Member.ParticipantID
- Participant.MemberID
and the table
- Participant_Eventsis still empty after the member has signup => The member doesnt get signed up..
| 689 Views | ||
|
Page:
1
|
Go to Top |

