I have defined association between Two of my models:
/app/models/TasksList.php
<?php
class TasksList extends AppModel {
var $useTable = 'tasks_lists';
var $uses=array('TasksPriority','TasksList');
var $belongsTo = array(
'TasksPriority' => array(
'className' => 'TasksPriority',
'foreignKey' => 'id'
)
);
}
?>
/app/models/TasksPriority.php
<?php
class TasksPriority extends AppModel {
var $uses=array('TasksPriority','TasksList');
var $useTable = 'tasks_priorities';
var $hasMany = array(
'TasksList' => array(
'className' => 'TasksList',
'foreignKey' => 'tasks_priorities_id'
)
);
}
?>
In my controller I use following to display the result:
$taskslist = $this->TasksList->findAll();
pr($taskslist);
The array here only prints the data from TasksList and not the
associated data. I don't know any way I could use to find where I am
wrong.
I will really appreciate any idea!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---