mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/sql-bool-builder] Changing syntax
Changing the syntax used to the one Nicofuma suggested. PHPBB3-13652
This commit is contained in:
parent
6806c20bce
commit
bb260f02e0
1 changed files with 5 additions and 5 deletions
|
@ -812,16 +812,16 @@ abstract class driver implements driver_interface
|
|||
if ($operations_ary[0] !== 'AND' &&
|
||||
$operations_ary[0] !== 'OR')
|
||||
{
|
||||
$operations_ary = array('AND', $operations_ary);
|
||||
$operations_ary = array('AND', array($operations_ary));
|
||||
}
|
||||
return $this->_process_boolean_tree($operations_ary) . "\n";
|
||||
}
|
||||
|
||||
protected function _process_boolean_tree($operations_ary)
|
||||
{
|
||||
$operation = array_shift($operations_ary);
|
||||
$operation = $operations_ary[0];
|
||||
|
||||
foreach ($operations_ary as &$condition)
|
||||
foreach ($operations_ary[1] as &$condition)
|
||||
{
|
||||
switch ($condition[0])
|
||||
{
|
||||
|
@ -917,11 +917,11 @@ abstract class driver implements driver_interface
|
|||
|
||||
if ($operation === 'NOT')
|
||||
{
|
||||
$operations_ary = implode("", $operations_ary);
|
||||
$operations_ary = implode("", $operations_ary[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$operations_ary = implode(" \n $operation ", $operations_ary);
|
||||
$operations_ary = implode(" \n $operation ", $operations_ary[1]);
|
||||
}
|
||||
|
||||
return $operations_ary;
|
||||
|
|
Loading…
Add table
Reference in a new issue