Skip to content

Instantly share code, notes, and snippets.

@davidpede
Created January 15, 2018 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidpede/905cb465cdbd655cd087f5e1f25fb37d to your computer and use it in GitHub Desktop.
Save davidpede/905cb465cdbd655cd087f5e1f25fb37d to your computer and use it in GitHub Desktop.
XPDO where examples
$query = $this->modx->newQuery('modUser');
//checks
$query->where(array(
'active' => 1,
'Profile.blocked' => 0
));
//by usergroup
$query->where(array('primary_group:IN' => array(1,2,3)));
//by id
$query->where(array('id:IN' => array(1,2,3)),xPDOQuery::SQL_OR); //<-- uses OR condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment