getResources does this for TV’s with actual values but does not work for TV’s with @ bindings or other dynamic values (e.g. @INHERIT or @EVAL or [[Snippet]]. In order to accomplish that, you would have to get all Resources, iterate over them, process the TV for each Resource, and filter them out with PHP code (versus in a SQL query).
Here is an example getResources call that does this:
[[getResources? &tvFilter=`blog_category==business`]]
So you can check out the getResources code to get some hints on how you might do this.
Further, if all your snippet is doing is getting a count of records, you should use getCount() instead of getCollection(), e.g.
<?php
$count = $modx->getCount('modResource', array(
'longtitle' => $criteria
)
);
return $count;
?>
Otherwise, you are sending a large amount of unnecessary data down the pipe between MySQL and PHP, as well as using a large amount of unnecessary memory and CPU resources in PHP hydrating the result set into modResource objects.