1

i am working on a cakephp test project, but im stuck for sometime now on getting the information from another table which is not directly related to the present model im retrieving the data.

the scenario is this:(please see image https://i.sstatic.net/liFmk.png) all the green tables are connected to each other, AC belongsTO {AA, AB} i have the aa_id.

How can i get the data from table AD using cakephp "find".

ie:

$params = array('conditions' => array('...' => $aa_id));

$this->aa->ab-ac->find('all',$params);

1 Answer 1

0

At the top of your controller you will find var $uses = array(...);, which contains a list of models immediately available in the controller. Add 'AD' to the list. You will then be able to call $this->AD->find(); anywhere in the controller.

Sign up to request clarification or add additional context in comments.

1 Comment

hmmm.. its not possible because i need to go through the 3 tables in order to get the value from AD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.