In a Custom Manager Page I am creating a new resource and want to a) create a new resource group and b) add the new resource to that resource group.
The code I am using for creating the resource itself is similar to the following:
$page = $this->modx->newObject('modDocument');
$pagedata = array( PAGEDATA HERE );
$newpageid = $page->get('id');
Can anyone give me any pointers for the methods to use: I guess I’m looking for something like "newObject(’modResourceGroup’)", then setResourceGroup($newpageid,$newgroupid) (Although obviously that would be a bit too easy!).
Thanks for any help in advance.