Skip to content

Commit c1fb121

Browse files
committed
Adapt to refactor "WITH" in Yii DB
1 parent 188ce3b commit c1fb121

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/DQLQueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function build(QueryInterface $query, array $params = []): array
7878
$sql = "$sql$this->separator$union";
7979
}
8080

81-
$with = $this->buildWithQueries($query->getWithQueries(), $params);
81+
$with = $this->buildWith($query->getWith(), $params);
8282

8383
if ($with !== '') {
8484
$sql = "$with$this->separator$sql";

tests/QueryBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ public function testBuildWithQuery(): void
248248
$with2Query = (new Query($db))->select('id')->from('t2')->innerJoin('a1', 't2.id = a1.id')->where('expr = 2');
249249
$with3Query = (new Query($db))->select('id')->from('t3')->where('expr = 3');
250250
$query = (new Query($db))
251-
->withQuery($with1Query, 'a1')
252-
->withQuery($with2Query->union($with3Query), 'a2')
251+
->addWith($with1Query, 'a1')
252+
->addWith($with2Query->union($with3Query), 'a2')
253253
->from('a2');
254254

255255
[$sql, $queryParams] = $qb->build($query);

0 commit comments

Comments
 (0)