Just a quick question to Jason:
Lets say we have one table set up as an xPDOSimpleObject:
<object class="CoCarts" table="co_carts" extends="xPDOSimpleObject">
... lots of fields here...
<composite alias="Products" class="CoCartProducts" local="id" foreign="cart_id" cardinality="many" owner="local" />
</object>
And one table set up with no Primary Key - an xPDOObject:
<object class="CoCartProducts" table="co_cart_products" extends="xPDOObject">
... lots of fields here...
<aggregate alias="Cart" class="CoCarts" local="cart_id" foreign="id" cardinality="one" owner="foreign" />
</object>
And then we try and do this:
$Cart= $xpdo->getObject('CoCarts',$validId);
$Cart->getMany('Products');
echo count($Cart->Products);
And the result is
zero, when the database says that there is one record in there with a matching FK of ’cart_id’. And yes, hydration is turned on.
The question is: Is this problem caused by the absence of a Primary Key field?
I ask this because the above code was working fine (as you imagine) when the table CoCartProducts had a primary key. I deleted the primary key since it served no purpose other than to threaten to hit the maximum integer limit rather quickly.