# How to do the contain in contain in model-\>get()

**URL:** <https://discourse.cakephp.org/t/how-to-do-the-contain-in-contain-in-model-get/863>\
**Category:** Need Help\
**Created:** [August 1, 2016, 10:35am UTC](https://discourse.cakephp.org/t/how-to-do-the-contain-in-contain-in-model-get/863 "2016-08-01T10:35:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LyBun](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@LyBun](https://discourse.cakephp.org/u/LyBun)\
**Post date:** [August 1, 2016, 10:35am UTC](https://discourse.cakephp.org/t/how-to-do-the-contain-in-contain-in-model-get/863/1 "2016-08-01T10:35:48Z")

</div>

For example: we purchases, purchasedetails and items table,  
now we are in action view of purchasesController and how to make this code work to get all items propertys  
$purchase = $this-\>Purchases-\>get($id, [‘contain’ =\> [‘Purchasedetails’ =\> [‘contain’ =\> ‘Items’] ]]); ?

Thanks,

---

<div class="post-metadata">

**Author:** ![Tao](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/tao/32/340_2.png) [@Tao](https://discourse.cakephp.org/u/Tao)\
**Post date:** [August 2, 2016, 6:28am UTC](https://discourse.cakephp.org/t/how-to-do-the-contain-in-contain-in-model-get/863/2 "2016-08-02T06:28:58Z")

</div>

u can try like:

```auto
$purchase = $this->Purchases->get($id, [
    'contain' => ['Purchasedetails.Items']
); 

```
