$c = $modx->newQuery('modUser');
$c->select($modx->getSelectColumns('modUser','modUser','',array('id','username')));
$c->innerJoin('modUserProfile','Profile');
$c->where(array(
'Profile.email:IN' => $email_array,
'modUser.active' => true,
));This question has been answered by Bruno17. See the first response.
Maybe we can somehow use both IN and LIKE for the array?yes, multiple ORs with LIKE.
Maybe we can somehow use both IN and LIKE for the array?yes, multiple ORs with LIKE.
$subwheres = array();
foreach ($email_array as $email){
$subwheres[] = array('OR:Profile.email:LIKE' => $email);
}
$c = $modx->newQuery('modUser');
$c->select($modx->getSelectColumns('modUser','modUser','',array('id','username')));
$c->innerJoin('modUserProfile','Profile');
$c->where(array(
'modUser.active' => true,
$subwheres
));