Skip to content

Commit 4a465a8

Browse files
authored
Merge pull request #26 from Linfuby/master
Fix use PHPixie\Database\Type\SQL\Expression in where in Query
2 parents 2ac3a95 + ea8b63c commit 4a465a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/PHPixie/ORM/Conditions/Builder/Container.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ public function __construct($conditions, $relationshipMap, $modelName, $defaultO
2121
public function addOperatorCondition($logic, $negate, $field, $operator, $values)
2222
{
2323
$relationship = null;
24-
25-
if (($pos = strpos($field, '>')) !== false || ($pos = strrpos($field, '.')) !== false) {
26-
$relationship = substr($field, 0, $pos);
27-
$field = substr($field, $pos + 1);
24+
if(is_string($field)) {
25+
if(($pos = strpos($field, '>')) !== false || ($pos = strrpos($field, '.')) !== false) {
26+
$relationship = substr($field, 0, $pos);
27+
$field = substr($field, $pos + 1);
28+
}
2829
}
2930

3031
$condition = $this->buildOperatorCondition($field, $operator, $values);

0 commit comments

Comments
 (0)