mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Throw error in filterValue() if an unstringable object is given
This commit is contained in:
parent
85be8b7669
commit
60552ba96b
1 changed files with 5 additions and 1 deletions
|
|
@ -398,7 +398,11 @@ class VariableBase
|
||||||
// Don't apply a filter if there is no variable.
|
// Don't apply a filter if there is no variable.
|
||||||
$column = $this instanceof ColumnWrite ? $this->name : $this->column;
|
$column = $this instanceof ColumnWrite ? $this->name : $this->column;
|
||||||
$filter = isset($this->filter) ? $this->filter : '';
|
$filter = isset($this->filter) ? $this->filter : '';
|
||||||
if (!is_array($value) && strval($value) === '')
|
if (is_object($value) && !method_exists($value, '__toString'))
|
||||||
|
{
|
||||||
|
throw new \Rhymix\Framework\Exceptions\QueryError('Variable ' . $this->var . ' for column ' . $column . ' is not stringable');
|
||||||
|
}
|
||||||
|
if (is_scalar($value) && strval($value) === '')
|
||||||
{
|
{
|
||||||
$filter = '';
|
$filter = '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue