Hi,
I'm trying to make a Match model which includes the players lined up during that match. So each Match hasMany Players and each Player hasmany Matches.
match = {
'_id' : ObjectID('978tqwbi9873gofiu'),
'home' : 'Argentina',
'away' : 'Brazil',
'lineup-home' : [
{'name' : 'Lionel Messi',
'goals' : '2',
'timeon' : 30
},
{'name' : 'Diego Maradonna',
'goals' : '0',
'timeon' : 0
},
{'name' : 'Sergio Aguero',
'goals' : '0',
'timeon' : 0
}
]
}
How do I add these 'lineup-home' relations in my CakePHP model to work with my mongoDB? This is how my model looks like...
class Match extends AppModel {
//var $useDbConfig = 'mongo';
var $mongoSchema = array(
'home' => array('type' => 'string'),
'away' => array('type' => 'string'),
'lineup-home' => ???
);
}
Thank you.