Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created February 5, 2014 16:45
Show Gist options
  • Save Fi1osof/8827909 to your computer and use it in GitHub Desktop.
Save Fi1osof/8827909 to your computer and use it in GitHub Desktop.
<?php
$q = $modx->newQuery('modResource');
$q->innerJoin('ShopmodxProduct', 'Product');
$q->leftJoin('modTemplateVarResource', 'tv', 'tv.contentid=modResource.id and tv.tmplvarid=29');
$q->where(array(
"tv.id" => null,
));
print $modx->getCount('modResource', $q);
foreach($modx->getCollection('modResource', $q) as $doc){
$doc->setTVValue(29, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment