Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from ray-di/dynamic_per_page
Support dynamic perPage parameter
- Loading branch information
Showing
11 changed files
with
303 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\MediaQuery\Exception; | ||
|
||
/** | ||
* The argument name specified in PerPage does not exist in the arguments of that method | ||
*/ | ||
class InvalidPerPageVarNameException extends LogicException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\MediaQuery\Exception; | ||
|
||
/** | ||
* PerPage type should be int | ||
*/ | ||
class PerPageNotIntTypeException extends LogicException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\MediaQuery\Queries; | ||
|
||
use Ray\MediaQuery\Annotation\DbQuery; | ||
use Ray\MediaQuery\Annotation\Pager; | ||
use Ray\MediaQuery\Pages; | ||
|
||
interface DynamicPerPageInterface | ||
{ | ||
/** | ||
* @DbQuery("todo_list") | ||
* @Pager(perPage="perPage", template="/{?page}") | ||
*/ | ||
#[DbQuery('todo_list'), Pager(perPage: 'perPage', template: '/{?page}')] | ||
public function __invoke(int $perPage): Pages; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\MediaQuery\Queries; | ||
|
||
use Ray\MediaQuery\Annotation\DbQuery; | ||
use Ray\MediaQuery\Annotation\Pager; | ||
use Ray\MediaQuery\Pages; | ||
|
||
interface DynamicPerPageInvalidInterface | ||
{ | ||
/** | ||
* @DbQuery("todo_list") | ||
* @Pager(perPage="__not_exsits_", template="/{?page}") | ||
*/ | ||
#[DbQuery('todo_list'), Pager(perPage: '__not_exsits_', template: '/{?page}')] | ||
public function __invoke(int $num): Pages; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\MediaQuery\Queries; | ||
|
||
use Ray\MediaQuery\Annotation\DbQuery; | ||
use Ray\MediaQuery\Annotation\Pager; | ||
use Ray\MediaQuery\Pages; | ||
|
||
interface DynamicPerPageInvalidType | ||
{ | ||
/** | ||
* @DbQuery("todo_list") | ||
* @Pager(perPage="perPage", template="/{?page}") | ||
*/ | ||
#[DbQuery('todo_list'), Pager(perPage: 'perPage', template: '/{?page}')] | ||
public function __invoke($perPage): Pages; | ||
} |
Oops, something went wrong.