Skip to content

add cursor-offset (pagination) #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Endpoints/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public function limit(int $limit): Endpoint
*/
public function offset(StartCursor $startCursor): Endpoint
{
// toDo
throw HandlingException::instance('Not implemented yet.', compact($startCursor));
$this->startCursor = $startCursor;
return $this;
}

}
2 changes: 1 addition & 1 deletion src/Query/Filters/Operators.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Operators
# ToDo: Make this a enum with PHP 8.1
const EQUALS = 'equals';
const DOES_NOT_EQUAL = 'does_not_equal';
const CONTAINS = 'contain';
const CONTAINS = 'contains';
const DOES_NOT_CONTAIN = 'does_not_contain';
const STARTS_WITH = 'starts_with';
const ENDS_WITH = 'ends_with';
Expand Down
4 changes: 4 additions & 0 deletions src/Query/StartCursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ public function __construct(string $cursor)
{
$this->cursor = $cursor;
}

public function __toString() {
return $this->cursor;
}
}