Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Created May 26, 2011 23:39
Show Gist options
  • Save Mark-H/994365 to your computer and use it in GitHub Desktop.
Save Mark-H/994365 to your computer and use it in GitHub Desktop.
$queryGraph = array();
if ($includeBrand) { $queryGraph[] = '"Brand":{}'; }
if ($includeImages) { $queryGraph[] = '"Images":{}'; }
if ($includeOwner) { $queryGraph[] = '"Owner":{}'; }
if ($includeOptions) { $queryGraph[] = '"CamperOptions":{ "Options":{} }'; }
$queryGraph = '{ '.implode(', ',$queryGraph).' }';
//echo '<pre>'.print_r($query->query,true).'</pre>';
$campers = $modx->getCollectionGraph('cmCamper',$queryGraph,$query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment