3432 Posts in 1058 Topics by 734 members
|Go to End|
29 May 2009 at 10:44pm
A team has many players (or rather, each player has exactly one team).
Each player has exactly one nationality.
Is there a built-in function to easily query all nationalities of one team?
DataObject::get_one('Team', 'Tiny Giants')->Players()->Nationalities();
DataObject::get_one('Team', 'Tiny Giants')->Nationalities(); // this is, BTW, RoR syntax for has_many :through
31 May 2009 at 3:17pm
My suggestion would be function column of DataObjectSet, as in:
DataObject::get_one('Team', 'Tiny Giants')->Players()->column('Nationality'); // returns an array for method or data item 'Nationality'
It is (currently) defined on or about line 675 of file sapphire/core/model/DataObjectSet.php
1 June 2009 at 11:56am
And if nationalities are DataObjects themselves?
|Go to Top|