Thanks for buying the book.
Take a look at the source code of getResources to see how to search with the TV values. BTW, this kind of search is particularly inefficient because the TV fields are not indexed for that kind of searching.
If you have a search-intensive operation, you'd be better off either using an unused resource field for the search criteria or a custom DB table with indexes on the search fields.
I should mention that you can also use a brute-force method where you get the resources with getCollection(), regardless of TV value, then check the TV value for each one with:
$resource->getTVValue($TvId);
filtering out the ones you don't want.
And . . . yes, you can use getResources in a snippet using
$modx->runSnippet('getResources', $props)
where $props is an array containing the property keys and values that you would have put in the snippet tag.
Remember, though, that what you'll get back from getResources is not an array of resources, it's the processed output of the getResources call using the Tpl chunk -- IOW, what you'd see on the page if you had a getResources tag there. That's probably not what you want.
[ed. note: BobRay last edited this post 12 years, 5 months ago.]