Can someone advise on patchEntity on a belongsToMany relationship?
I have the following code:
$creditIntermediary =
$this->CreditIntermediaries->patchEntity($creditIntermediary,$this->request->data['credit_intermediary'],
[
'associated' => [
'CreditIntermediaryTypes'
]
]);
The entity, both bef
That sounds like one table too many to me. You can get what you want by doing
simple finds, made even easier by using the containable behaviour, IMO.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 10 Aug 2010, at 11:26, Felix wrote:
> Thanks, Jeremy, Andras
Thanks, Jeremy, Andras - I think I've worked it out now,
I wanted to keep the HABTM relationship so I could easily list all the
products in an order and find all the orders a particular product is
listed in, the HABTM seems the easiest way to do it so I'll leave that
as it is. I've added an additi
Felix,
for a simple cart not sure if habtm is needed...
could be:
products
id | name | description | image | price | qty
orders
id | name | address | grandtotal | tracking | status |
order hasmany orderi_tems
order_items
id | order_id | product_id | qty | price |...
I'd be tempted to have an order_items table that is not ruled by habtm. Then
you can add columns for product_id, quantity, price_charged, tax, dispatched
etc.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 9 Aug 2010, at 17:27, Felix wrote:
> Hi, I was won
Hi, I was wondering if anyone can help with a problem I'm having.
I'm building a simple shopping cart system for which I have two
objects
1. Product (stores product details - name, cost, SKU, etc.)
2. Order (Stores order details - customer address, shipping type,
etc.)
In the database these are