Internal: query arguments could be array values, making it easier to build dynamic IN() clauses

SVN:trunk[4006]
This commit is contained in:
Romain Quetiez
2016-04-19 13:59:43 +00:00
parent 0386c53a6a
commit 2a835e5be4
2 changed files with 10 additions and 2 deletions

View File

@@ -2488,7 +2488,10 @@ abstract class MetaModel
{
$aScalarArgs[$sArgName] = null;
}
// otherwise... could be an array coming from the extra params...
elseif (is_array($value))
{
$aScalarArgs[$sArgName] = $value;
}
}
}
// Add standard magic arguments

View File

@@ -648,7 +648,12 @@ class VariableExpression extends UnaryExpression
}
elseif (array_key_exists($this->m_sName, $aArgs))
{
return CMDBSource::Quote($aArgs[$this->m_sName]);
$res = CMDBSource::Quote($aArgs[$this->m_sName]);
if (is_array($res))
{
$res = implode(', ', $res);
}
return $res;
}
elseif (($iPos = strpos($this->m_sName, '->')) !== false)
{