Suppoprt more complicated cache queries, e.g. AND (tags LIKE ' tag1 ' OR tags LIKE ' tag2 ')
This commit is contained in:
parent
4a0c47de0b
commit
5f306222f2
1 changed files with 11 additions and 1 deletions
|
@ -417,7 +417,17 @@ class kolab_storage_cache
|
|||
{
|
||||
$sql_where = '';
|
||||
foreach ($query as $param) {
|
||||
if ($param[1] == '=' && is_array($param[2])) {
|
||||
if (is_array($param[0])) {
|
||||
$subs = array();
|
||||
foreach ($param[0] as $q) {
|
||||
$subq[] = preg_replace('/^\s*AND\s+/i', '', $this->_sql_where(array($q)));
|
||||
}
|
||||
if (!empty($subq)) {
|
||||
$sql_where .= ' AND (' . implode($param[1] == 'OR' ? ' OR ' : ' AND ', $subq) . ')';
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ($param[1] == '=' && is_array($param[2])) {
|
||||
$qvalue = '(' . join(',', array_map(array($this->db, 'quote'), $param[2])) . ')';
|
||||
$param[1] = 'IN';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue