New to cake here... using 1.2
I've got three models:
Players
Games
Scores
class Player extends AppModel
{
public $name = 'Player';
public $hasAndBelongsToMany = array('Game');
public $hasMany = array('Score');
}
class Game extends AppModel
{
public $name = 'Game';
public $hasAndBelongsToMany = array('Player');
public $hasMany = array('Score');
}
class Score extends AppModel {
public $belongsTo = array('Game', 'Player');
}
I'm building a profile controller action:
/players/profile/username
public function profile($username) {
$player = $this->Player->find(array('username' => $username),
null, null, 2);
$this->set('player',$player);
}
The return array has the Games key, with ALL the scores for that
game. how can I get only score for that game for the player i'm
interested in. For each game, there will only be one score per
Player.
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---