I've got three DataObjects in Silverstripe 3.1: an Issue, a Vote, and a Voter. Issues have many Votes; Votes have one Voter and one Issue. On my Issue_show page, I want to show all that Issue's Votes, sorted by Voter's Name.
The function in the Issue looks like this:
public function MyVotes() {
return $this->Votes();
}
But I can't figure out how to access the Voter's Name to sort by it. Presumably, it should be something like
public function MyVotes() {
return $this->Votes()->sort('Voter.Name');
}
but that throws an error. What step am I missing?