patchEntity on belongsToMany relationship advice needed

2014-09-12 Thread rsflatt
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

Re: relationship advice

2010-08-10 Thread Jeremy Burns | Class Outfit
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

Re: relationship advice

2010-08-10 Thread Felix
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

Re: relationship advice

2010-08-09 Thread Andras Kende
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 |...

Re: relationship advice

2010-08-09 Thread Jeremy Burns | Class Outfit
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

relationship advice

2010-08-09 Thread Felix
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