Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 653167a

Browse files
committed
PHPORM-63 Remove unused public property Query\Builder::$paginating
1 parent cf103ba commit 653167a

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/Query/Builder.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ class Builder extends BaseBuilder
5959
*/
6060
public $options = [];
6161

62-
/**
63-
* Indicate if we are executing a pagination query.
64-
*
65-
* @var bool
66-
*/
67-
public $paginating = false;
68-
6962
/**
7063
* All of the available clause operators.
7164
*
@@ -574,16 +567,6 @@ public function whereBetween($column, iterable $values, $boolean = 'and', $not =
574567
return $this;
575568
}
576569

577-
/**
578-
* @inheritdoc
579-
*/
580-
public function forPage($page, $perPage = 15)
581-
{
582-
$this->paginating = true;
583-
584-
return $this->skip(($page - 1) * $perPage)->take($perPage);
585-
}
586-
587570
/**
588571
* @inheritdoc
589572
*/

tests/Query/BuilderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ public static function provideQueryBuilderToMql(): iterable
6565
fn (Builder $builder) => $builder->limit(10)->offset(5)->select('foo', 'bar'),
6666
];
6767

68+
/** @see DatabaseQueryBuilderTest::testForPage() */
69+
yield 'forPage' => [
70+
['find' => [[], ['limit' => 20, 'skip' => 40]]],
71+
fn (Builder $builder) => $builder->forPage(3, 20),
72+
];
73+
6874
/** @see DatabaseQueryBuilderTest::testOrderBys() */
6975
yield 'orderBy multiple columns' => [
7076
['find' => [[], ['sort' => ['email' => 1, 'age' => -1]]]],

0 commit comments

Comments
 (0)