DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]Wazzu[/eluser]
Advanced Relationship Hi all. I'm not able to understand how advanced relationships work. I've read user guide and made tests, but I can't understand how field names are used. This is my sample case: - table users(id, name) - table quotes(id, client_id, worker_id) - user model and quote model One user (worker_id) can create a new quote for other user (client_id). 'worker_id' and 'client_id' are in fact ids from users table. How should I make relationships? This is what I've done: Code: class Quote extends DataMapper { Code: class User extends DataMapper { Is that right? And from my controller, how should I populate this? I want to get something like this: Code: <?php Please, help me understanding this relationships. Thanks all |
Welcome Guest, Not a member yet? Register Sign In |