Skip to content

Instantly share code, notes, and snippets.

@avoronkin
Created February 15, 2011 16:53
Show Gist options
  • Save avoronkin/827794 to your computer and use it in GitHub Desktop.
Save avoronkin/827794 to your computer and use it in GitHub Desktop.
return all resources with a specific TV value
<?php
$c = $modx->newQuery('modResource');
$c->innerJoin('modTemplateVarResource','TemplateVarResources');
$c->innerJoin('modTemplateVar','TemplateVar','TemplateVarResources.tmplvarid = TemplateVar.id');
$c->where(array(
'TemplateVar.name' => 'access_front',
'TemplateVarResources.value' => true,
));
$ress = $modx->getCollection('modResource',$c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment