modResource.isMember
Last updated Oct 11th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodResource::isMember¶
Checks whether a Resource belongs to one or more Resource Groups.
Syntax¶
boolean isMember (string|array $groups [, boolean $matchAll = false])
| Parameter | Description |
|---|---|
$groups |
Resource Group name or an array of Resource Group names |
$matchAll |
true — require membership in every group of the array; false (default) — membership in any one group is enough. No effect when $groups is a single string. |
Example¶
Get a Resource object:
$resource = $modx->getObject('modResource', array('id' => 2));
Check membership in the ‘Marketing’ Resource Group:
$resource->isMember('Marketing');
Check membership in either the ‘Marketing’ or the ‘Finances’ Resource Group:
$resource->isMember(array('Marketing', 'Finances'));
Check membership in both Resource Groups at once:
$resource->isMember(array('Marketing', 'Finances'), true);
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










