Skip to content

Commit 15b6a33

Browse files
committed
misc fixes
1 parent 9893a58 commit 15b6a33

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

packages/orm/src/SelectorQuery.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Windwalker\ORM\Metadata\EntityMetadata;
1818
use Windwalker\ORM\Relation\Strategy\ManyToMany;
1919
use Windwalker\Query\Clause\AsClause;
20+
use Windwalker\Query\Clause\ClauseInterface;
2021
use Windwalker\Query\Clause\JoinClause;
2122
use Windwalker\Query\Query;
2223
use Windwalker\Utilities\Arr;
@@ -350,9 +351,12 @@ function (AsClause $clause) use ($colExtracted) {
350351
return [$colAttr, $metadata];
351352
}
352353

353-
protected function handleOperatorAndValue(string $column, mixed $operator, mixed $value): array
354-
{
355-
if ($value !== null) {
354+
protected function handleOperatorAndValue(
355+
string|ClauseInterface $column,
356+
mixed $operator,
357+
mixed $value
358+
): array {
359+
if ($value !== null && is_string($column)) {
356360
[$colAttr] = $this->getColumnInfoFromColumnString($column);
357361

358362
if ($colAttr && $prop = $colAttr->getProperty()) {

packages/query/src/Concern/WhereConcernTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public function where(mixed $column, mixed ...$args): static
9797
* a named param like: `:wqp__{ordering}` and re-calc the order when every time rendering Query object,
9898
* so we can make sure the variables won't be conflict.
9999
*
100-
* @param string $column
101-
* @param mixed $operator
102-
* @param mixed $value
100+
* @param string|ClauseInterface $column
101+
* @param mixed $operator
102+
* @param mixed $value
103103
*
104104
* @return array
105105
*/
106106
protected function handleOperatorAndValue(
107-
string $column,
107+
string|ClauseInterface $column,
108108
mixed $operator,
109109
mixed $value,
110110
): array {

0 commit comments

Comments
 (0)