I have two find statements and need the results of one find statement to use in the second find statement however the two methods I have tried to use have come back with errors
here is the first find statement, it lists the sender_id's
$sender=$this->Invoice->Find('list', array('fields'=>('sender_id')));
here is the second find statement, it takes that list of sender_id's and returns the corresponding company_name
$senderName=$this->Account->Find('all', array(
'conditions' => array(
$sender=>'account.id')));
this returns the right information however returns this error Warning (2): Illegal offset type [APP\Controller\InvoicesController.php, line 185]
so i tried doing it this way
$senderName=$this->Account->Find('all', array(
'conditions' => array(
'id'=>$sender['Invoice']['sender_id'])));
and get an undefined index on invoice.