Ok, I don't get through the complete example, but using options when declaring the association should work.
Given a Post belongs_to an Author. But the Author is actually a Person.
class Post...
var belongs_to = array('author'=>array('class_name'=>'Person','primary_key_name'=>'written_by'));
class Person...
var has_many = array('Post'=>array('foreign_key'=>'written_by'));
so a Match could belong_to a HomeTeam with
class_name: Team
primary_key_name: HOME_TEAM_ID
hope it helps
is this a semantic thing?
class Match...
var $belongs_to = array(
'home_team' => array('class_name'=>'Team','primary_key_name'=>'home_team_id'),
'away_team' => array('class_name'=>'Team','primary_key_name'=>'away_team_id')
);
primary_key_name refers to a local_column. It is primary to the association not to a table. I.e. it is not the primary_key of neither the Match_Model nor the Team-Model, but it points to the primary_key of the Team-Model.
Now:
$Match = $this->Match->find('first',array('include'=>array('home_team','away_team')));
$Match->home_team->name
$Match->away_team->name
//given the teams-table has a column 'name'
#
$this->TeamMatchup->find('all',
array('include'=> array('home_team','away_team','week')),
$this->pagination_helper->getFindOptions($this->TeamMatchup));
The finder only takes one options-array, as its last argument.
Try
$options = array_merge(paginator_options,array('include'...));
something like this.
1 to 8 of 8