Hi,
I have defined four MySQL tables:
accounts
games
games_to_accounts
status
A typical many-to-many relationship involving accounts, games, and games_to_accounts is in place. However the games_to_accounts table has an extra field, status_id, which defines how the associated account is treating the game (playing, for sale, etc).
I can retrieve an account's games per usual just fine:
$account->Games
In the GameAccount base model I've defined the hasOne relationship with the Status model like this:
$this->hasOne('Default_Model_Status as Status', array(
'local' => 'status_id',
'foreign' => 'id'));
However when iterating over these games why in the world can't I retrieve the status? Example:
foreach ($account->Games as $game)
{
echo $game->Status->name;
}
Surely Doctrine supports the ability to add extra fields to an association table? Any help much appreciated, as I've looked everywhere for an answer yet am turning up nothing on what strikes me as a commonplace issue.
Jason