Issue #1565972 by c960657: Clean-up of mapConditionOperator().

8.0.x
catch 2012-05-12 12:15:33 +09:00
parent 926cbd6694
commit 2a3251a829
1 changed files with 6 additions and 12 deletions

View File

@ -157,18 +157,12 @@ class Connection extends DatabaseConnection {
}
public function mapConditionOperator($operator) {
static $specials;
// Function calls not allowed in static declarations, thus this method.
if (!isset($specials)) {
$specials = array(
// In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE
// statements, we need to use ILIKE instead.
'LIKE' => array('operator' => 'ILIKE'),
'NOT LIKE' => array('operator' => 'NOT ILIKE'),
);
}
static $specials = array(
// In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE
// statements, we need to use ILIKE instead.
'LIKE' => array('operator' => 'ILIKE'),
'NOT LIKE' => array('operator' => 'NOT ILIKE'),
);
return isset($specials[$operator]) ? $specials[$operator] : NULL;
}