If you want an array of the TV objects themselves (rather than the TV values associate with individual resources), you could use
$modx->getCollection('modTemplateVar');
If you need the raw or processed value of the TVs associated with specific resources, you can get the resources first and then loop through them and get their TVs with getMany. Something like this:
$resources = $modx->getCollection('modResource');
foreach $resources as $resource {
$id = $resource->get('id');
$tvs = $resource->getMany('TemplateVars');
foreach ($tvs as $tv) {
$rawValue = $tv->getValue($id);
$processedValue = $tv->renderOutput($id);
}
}
There’s probably a way to get the resources and their TVs in one call with getCollectionGraph(), but I’m not sure what the second argument would be or how to extract the TV values.