mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 03:04:09 +02:00
Merging r10491 and r10492: Add sql_bit_or() dbal method. Add ability to enable quick reply in all forums. -- Voila ;-)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_7@10529 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -429,6 +429,24 @@ class dbal
|
||||
return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run binary OR operator on DB column.
|
||||
* Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}"
|
||||
*
|
||||
* @param string $column_name The column name to use
|
||||
* @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
|
||||
* @param string $compare Any custom SQL code after the check (for example "= 0")
|
||||
*/
|
||||
function sql_bit_or($column_name, $bit, $compare = '')
|
||||
{
|
||||
if (method_exists($this, '_sql_bit_or'))
|
||||
{
|
||||
return $this->_sql_bit_or($column_name, $bit, $compare);
|
||||
}
|
||||
|
||||
return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run more than one insert statement.
|
||||
*
|
||||
|
@@ -451,6 +451,11 @@ class dbal_firebird extends dbal
|
||||
return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
function _sql_bit_or($column_name, $bit, $compare = '')
|
||||
{
|
||||
return 'BIN_OR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* return sql error array
|
||||
* @access private
|
||||
|
@@ -622,6 +622,11 @@ class dbal_oracle extends dbal
|
||||
return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
function _sql_bit_or($column_name, $bit, $compare = '')
|
||||
{
|
||||
return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* return sql error array
|
||||
* @access private
|
||||
|
Reference in New Issue
Block a user