public function getCondition()
{
$conditionString = '';
$conditionParams = $this->getConditionParams();
$db = \Pimcore\Db::get();
if (!empty($conditionParams)) {
$params = [];
$i = 0;
foreach ($conditionParams as $key => $value) {
if (!$this->condition && $i == 0) {
$conditionString .= $key . ' ';
} else {
$conditionString .= ' ' . $value['concatenator'] . ' ' . $key . ' ';
}
// If there is not a placeholder, ignore value!
if (!$value['ignore-value']) {
if (is_array($value['value'])) {
foreach ($value['value'] as $k => $v) {
if ($db->supportsParameters("named")) {
$params[$k] = $v;
} else {
$params[] = $v;
}
}
} else {
$params[] = $value['value'];
}
}
$i++;
}
$this->setConditionVariables($params);
}
$condition = $this->condition . $conditionString;
return $condition;
}