Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Help getting certain Members


Go to End


533 Views

Avatar
woodb2

Community Member, 48 Posts

29 March 2012 at 7:33am

I'm trying to get members that belong to a particular group (security groups I've created) and a particular Team (Team is a decorated field of Member).

I can get all the users of a group using:

function MemberList(){
$group = DataObject::get_one("Group", "Title = '$this->GroupName'"); //GroupName is a field on the page that I make the same as the security group
$members = $group->Members();
return $members;

How can I refine the results to also filter by Team?

Thanks,
Brian