Use create() to instantiate Member_GroupSet on Member::Groups()

Keeps it consistent with how HasManyList and ManyManyList are
instantiated in DataObject.
This commit is contained in:
Sean Harvey 2013-05-22 13:56:36 +12:00
parent e2553fa864
commit abad856534

View File

@ -988,7 +988,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
* @todo Push all this logic into Member_GroupSet's getIterator()?
*/
public function Groups() {
$groups = Injector::inst()->create('Member_GroupSet', 'Group', 'Group_Members', 'GroupID', 'MemberID');
$groups = Member_GroupSet::create('Group', 'Group_Members', 'GroupID', 'MemberID');
$groups = $groups->forForeignID($this->ID);
$this->extend('updateGroups', $groups);