modResource.leaveGroup
Last updated not available | 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.leaveGroup¶
Removes the Resource from a Resource Group by deleting the modResourceGroupResource row. Unlike joinGroup(), there is no $byName flag: an integer is matched against id, anything else against name.
Returns false when the group is not found or the Resource is not a member; both cases are logged. Otherwise it returns the result of deleting the membership row. The OnResourceRemoveFromResourceGroup event is invoked by processors, not by this method.
Syntax¶
boolean leaveGroup ($resourceGroupPk)
-
$resourceGroupPk(int|string|modResourceGroup) ID, name or object of the group
Example¶
$resource = $modx->getObject('modResource', array('id' => 5));
$resource->leaveGroup('staff');
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










