Skip to content
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

Red 1953 pagination #513

Merged
merged 18 commits into from
Oct 31, 2023
Merged

Red 1953 pagination #513

merged 18 commits into from
Oct 31, 2023

Conversation

ecoologic
Copy link
Collaborator

@ecoologic ecoologic commented Oct 19, 2023

Implement the solution that works with all types of pagination (obp / cbp / single page). Defaults to CBP.

Screenshot 2023-10-27 at 9 35 05 am

** Update: I extracted the iterator in its own trait.

@ecoologic ecoologic force-pushed the RED-1953-pagination branch 2 times, most recently from ea8e02c to a1af75a Compare October 25, 2023 04:42
{
return new TicketsIterator($this);
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved into trait to make it generic to all resources.

@ecoologic ecoologic force-pushed the RED-1953-pagination branch 2 times, most recently from 0da9b00 to c4bd841 Compare October 26, 2023 02:00

private function paginationStrategyClass() {
return ObpStrategy::class;
}
Copy link
Collaborator Author

@ecoologic ecoologic Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const are not available in traits in the current PHP version (7.4)


private function paginationStrategyClass() {
return CbpStrategy::class;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will act as default

@ecoologic ecoologic force-pushed the RED-1953-pagination branch 4 times, most recently from 8b96def to 2cca4bb Compare October 30, 2023 06:30
@ecoologic ecoologic requested review from a team and 7ail October 30, 2023 06:32
@ecoologic ecoologic marked this pull request as ready for review October 30, 2023 06:39
@@ -8,6 +8,9 @@ services:
- .:/app
- vendor:/app/vendor
command: vendor/bin/phpunit --testsuite "Zendesk API Unit Test Suites"
# command: vendor/bin/phpunit tests/Zendesk/API/UnitTests/Traits/Utility/PaginationTest.php
# command: vendor/bin/phpunit tests/Zendesk/API/UnitTests/Core/TicketsTest.php
# command: vendor/bin/phpunit tests/Zendesk/API/UnitTests/Core/OrganizationMembershipsTest.php
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do some cleaning at the end, but these comments come useful to switch between tests.

@ecoologic ecoologic merged commit 9d2811a into master Oct 31, 2023
2 checks passed
@ecoologic ecoologic deleted the RED-1953-pagination branch October 31, 2023 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants