protected function buildFilter(array $cols, array $filter, $qb, $andx)
{
foreach ($filter as $key => $values) {
if (!is_array($values)) {
$values = array($values);
}
$orx = $qb->expr()->orx();
switch ($key) {
case 'status':
$mapper = array_flip(Feedback::$status_enum);
foreach ($values as $value) {
$orx->add($qb->expr()->eq('e.status', $mapper[$value]));
}
break;
case 'attachmentType':
$mapper = array_flip(Feedback::$attachment_type_enum);
foreach ($values as $value) {
$orx->add($qb->expr()->eq('e.attachment_type', $mapper[$value]));
}
}
$andx->add($orx);
}
return $andx;
}