Monday, September 15, 2008

multiple model

i have wrote the following code to use mulitple model
class AutoLinkExchangesController extends AppController {
var $name = 'AutoLinkExchanges';
var $uses=array('AutoLinkExchange','AutoHyperLink');

function admin_autohyperlink_index(){

if(!empty($this->data))
{
$criteria=NULL;
list($order,$limit,$page) = $this->Pagination->init($criteria);
$data = $this->AutoHyperLink->findAll($criteria, NULL, $order,
$limit, $page);

}

it shows me the queryu with "ORDER BY `AutoLinkExchange`.`id` " but i
am using AutoHyperLink model
and one more thing when i change the position of model in uses like
var $uses=array('AutoHyperLink','AutoLinkExchange');
then it does not show me any error and both model do not have any
relation.
Plz suggest me the solution......
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: