I could be wrong, but I don’t think getResources will do that at this point. If you can limit the resources to search in some way, it might not be to bad to do something like this:
<?php
/* This assumes that the resources are under a particular container with an id of 12 */
$resources = $modx->getCollection('modResource',array('parent'=>12));
foreach ($resources as $resource) {
$cost = $resource->getTVValue('cost');
$matches = array();
if ($cost > 20 && cost < 45) {
$matches[] = $resource;
}
}
foreach($matches as $match) {
$output .= $modx->getChunk('itemTpl', $match->toArray());
}
return $output;
If you can create an array containing all the possible resource IDs (say with $ids = $modx->getChildIds()), it might be faster to get the TV object and check all the values with $cost = $tv->getValue(), adding the matches to an array of ids, then get the matching resource with getCollection() and display them with same loop used above.