$resourceId = $modx->resource->get('id');
$array_ids = $modx->getChildIds($resourceId);
array_push($array_ids, $resourceId);$actions = $modx->getCollection('Useractions',array('resource_id'=> array($resourceId)));$c = $xpdo->newQuery('userAction');
$c->where(array(
'resource_id:IN' => $array_ids));
$actions = $modx->getCollection('Useractions', $c);
Is 'Useractions' your own object class (there isn't one in MODX) and have you generated the class and map files to make it xPDO-friendly?
If so, I think you could do it in a single query with a join, (or possibly getObjectGraph() if your schema allows it), but since you already have the IDs in an array, this might be what you want:
$c = $xpdo->newQuery('userAction'); $c->where(array( 'resource_id:IN' => $array_ids)); $actions = $modx->getCollection('Useractions', $c);
$c = $xpdo->newQuery('userAction');