I don't think you'll get the functionality you want with getResources. (someone correct me if i'm wrong.)
I wrote a script that should do what you want, although its probably expensive since i'm pulling in every field from the resource. (this means you could use every field if you wanted to...)
If you need to tone down on what is called, you can modify the script below only get things you need.
getResourceParents (snippet)
<?
$children = explode(',', $parents);
$parentIDs = [];
foreach($children as $key => $value){
$temp = $modx->getObject('modResource', $value);
$parentIDs[$key] .= $temp->get('parent');
}
$tmp = [];
foreach ($parentIDs as $key => $parent){
array_push($tmp, $modx->getObject('modResource', $parent)->_fields);
}
function subval_sort($a,$subkey) {
foreach($a as $k=>$v) {
$b[$k] = strtolower($v[$subkey]);
}
arsort($b);
foreach($b as $key=>$val) {
$c[] = $a[$key];
}
return $c;
}
$tmp = array_unique($tmp, SORT_REGULAR);
$tmp = subval_sort($tmp,'createdon');
foreach($tmp as $key => $temp){
$o .= $modx->getChunk($tpl, $temp);
}
return $o;
Snippet Call
[[!getResourceParents?
&children=`40,11,22,28`
&tpl=`chunk.tpl`
]]
chunk.tpl
[[+id]]<br>
[[+alias]]<br>
Just some notes if this does happen to work for you:
1. &children needs to have no spaces, since i'm taking the value and making an array from it.
2. The chunk can use any field from the database table as i've noted above. So you can use pagetitle, description, createdon, content, etc.
Note: i'm not a php pro, so you'll probably get better advice from someone else