Get tree list with association table

I have table tree and text table, I need the other table not to make array, but to have straight columns from the table.

     $data = $this->Navigations->find('children', [
        'for' => 2,
        'contain' => [
            'NavigationsSlugs' => [
                'conditions' => [
                    'NavigationsSlugs.language_id' => 1
                ]
            ]
        ],
        'conditions' => [
            'Navigations.aktivni' => 1
        ]
    ])->find('threaded');

NavigationsSlugs table - has no array, but only columns … is it possible?

Thank You!

You need to define a HasOne association instead of a HasMany.

1 Like