StateHistoryQuery: Make whereToSql robust
This fixes bugs is a array for expression comes in or types does not exist. fixes #7133
This commit is contained in:
parent
da7e599363
commit
9c2cf0bd0f
|
@ -38,8 +38,11 @@ class StatehistoryQuery extends IdoQuery
|
|||
{
|
||||
if ($col === 'UNIX_TIMESTAMP(sh.state_time)') {
|
||||
return 'sh.state_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression));
|
||||
} elseif ($col === $this->columnMap['statehistory']['type']) {
|
||||
return 'sh.state_type ' . $sign . ' ' . $this->types[$expression];
|
||||
} elseif ($col === $this->columnMap['statehistory']['type']
|
||||
&& is_array($expression) === false
|
||||
&& array_key_exists($expression, $this->types) === true
|
||||
) {
|
||||
return 'sh.state_type ' . $sign . ' ' . $this->types[$expression];
|
||||
} else {
|
||||
return parent::whereToSql($col, $sign, $expression);
|
||||
}
|
||||
|
@ -58,4 +61,3 @@ class StatehistoryQuery extends IdoQuery
|
|||
$this->joinedVirtualTables = array('statehistory' => true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue