# CakePHP 4.x Table::find('all', \[\]) does not recognize 'contain' option

**URL:** <https://discourse.cakephp.org/t/cakephp-4-x-table-find-all-does-not-recognize-contain-option/7097>\
**Category:** Need Help\
**Created:** [January 13, 2020, 7:26am UTC](https://discourse.cakephp.org/t/cakephp-4-x-table-find-all-does-not-recognize-contain-option/7097 "2020-01-13T07:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![general2000vn](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@general2000vn](https://discourse.cakephp.org/u/general2000vn)\
**Post date:** [January 13, 2020, 7:26am UTC](https://discourse.cakephp.org/t/cakephp-4-x-table-find-all-does-not-recognize-contain-option/7097/1 "2020-01-13T07:26:09Z")

</div>

I have 2 queries as below, only the one with **get($id, ‘content’ =\> [])** works. The **find(‘all’, ‘content’ =\> [])** does only show ID instead of name of related content data.

```
    //get all campaign , and their related data
    $test = $this->Campaigns->find('all', ['contain' => ['Handlers','Creators']]);
    
    //set to view variable to see in debuger 
    $this->set('test', $test);
    
    //get only campaign id = 1, and it's related data
    $test1 = $this->Campaigns->get(1, ['contain' => ['Handlers','Creators']]);
    
    $this->set('test1', $test1);

```

Only **$test1** include Handlers and Creators  
while **$test** does not.

What should I do with this? I will put the **$test** into **paginator** as well.

---

<div class="post-metadata">

**Author:** ![Salines](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/salines/32/3420_2.png) [@Salines](https://discourse.cakephp.org/u/Salines)\
**Post date:** [January 13, 2020, 9:13am UTC](https://discourse.cakephp.org/t/cakephp-4-x-table-find-all-does-not-recognize-contain-option/7097/2 "2020-01-13T09:13:06Z")

</div>

> [@general2000vn](#):
>
> $test = $this-\>Campaigns-\>find(‘all’, [‘contain’ =\> [‘Handlers’,‘Creators’]]);

try:

$test = $this-\>Campaigns-\>find()-\>contain([‘Handlers’,‘Creators’]]);

---

<div class="post-metadata">

**Author:** ![general2000vn](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@general2000vn](https://discourse.cakephp.org/u/general2000vn)\
**Post date:** [January 22, 2020, 5:03am UTC](https://discourse.cakephp.org/t/cakephp-4-x-table-find-all-does-not-recognize-contain-option/7097/4 "2020-01-22T05:03:42Z")

</div>

Thank you very much Salines,

I have tried the code you gave, it works.

So that mean CakePHP 4.0.1 has bug with Table querry, right?
