Welcome Guest, Not a member yet? Register   Sign In
Datamapper ORM Multi-tabel Relationship Halp!
#6

[eluser]WanWizard[/eluser]
Sorry about the typo. Wink

No, Purchases -> has_one -> Options. Not has_many, you're using an in-table FK, so one purchase record can only point to one option record.

If you want to know all options for the purchase of a specific template, use
Code:
$user = new User(1);
$template = new Template(16);

// get the details of the purchase of template 16 by user 1
$purchase = new Purchase();
$purchase->where_related($user)->where_related($template)->option->get();


Messages In This Thread
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 07-27-2011, 12:34 PM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 07-28-2011, 02:04 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-04-2011, 07:18 PM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-05-2011, 04:49 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-05-2011, 08:54 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-05-2011, 11:37 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-06-2011, 03:44 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-06-2011, 04:01 AM
Datamapper ORM Multi-tabel Relationship Halp! - by El Forum - 08-06-2011, 01:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB