Say I have the next models:

```
Order hasMany OrderLine   (OrderLine belongsTo Order)
OrderLine hasOne Product  (Product belongsTo OrderLine)

```

I want to save a new Order with many OrderLines where each OrderLine has one Product.
For example: a user want to buy a 'PS3' and a 'XBOX' so my database must be like this:

```
orders
+----+-------- +
| id | user_id |
+--------------+
| 1  | 10      |

orders_line
+------+----------+------------+
| id   | order_id | product_id |
+-----------------+------------+
| 100  |   1      |   1001     |
| 101  |   1      |   1002     |

products
+-------+------+
| id    | name | ...
+--------------+
| 1001  | PS3  |
| 1002  | BOX  |

```

I can save the Order and the OrderLines with `saveAll` 

**OrdersController.php**

```
  public function add() {
     if ($this->request->isPost()) {
        $this->Order->create();
        $this->request->data['Order']['user_id'] = $this->Auth->user('id');
        $this->Order->saveAll($this->request->data);
     }
  }

```

That works nice. But I don't know how to save the Products elements.

My form:

```
<form ...>
<div id="order-lines">
   <div>
      <input name="data[OrderLine][0][user_id]" type="hidden">
      <div class="span3">
         <label>myfield/label>
         <input name="data[Product][0][myfield]" type="text" id="Product0Myfield">
      </div>
      <div>
         <label>fieldb</label>
         <input name="data[Product][0][fieldb]" type="text" id="Product0Fieldb">
      </div>

   <div>
      <input name="data[OrderLine][1][id]" type="hidden">
      <div>    
         <input name="data[Product][1][id]" type="hidden">
         <label>myfield</label>
         <input name="data[Product][1][myfield]" type="text" id="Product1Myfield">
      </div>

      <div class="span3">
         <label>fieldb</label>
         <input name="data[Product][1][fieldb]" type="text" id="Product1Fieldb">
      </div>
    </div>
</div>
</form>

```

I've tried this:

```
foreach ($this->request->data['OrderLine'] as &$orderLine) {
    // create the product and populate it with form data
    $this->Product->create();
    $this->Product->save($this->request->data);
    // trying to update the OrderLine foreign key
    $orderLine['product_id'] = $this->Product->id; // doesn't works 
}

```

Any help will be much appreciated.