Skip to content

Commit

Permalink
TicketsIterator::DEFAULT_PAGE_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoologic committed Oct 17, 2023
1 parent a33faf0 commit 6427d28
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Zendesk/API/Traits/Utility/TicketsIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
*/
class TicketsIterator implements Iterator
{
/**
* The default number of items per page for pagination.
*/
public const DEFAULT_PAGE_SIZE = 100;

/**
* @var Zendesk\API\HttpClient The Zendesk API client.
*/
Expand Down Expand Up @@ -39,14 +44,13 @@ class TicketsIterator implements Iterator
*/
private $started = false;

// TODO: pageSize = 100
/**
* TicketsIterator constructor.
*
* @param \stdClass $resources implementing the iterator ($this), with findAll()
* @param int $pageSize The number of tickets to fetch per page.
*/
public function __construct($resources, $pageSize = 2)
public function __construct($resources, $pageSize = self::DEFAULT_PAGE_SIZE)
{
$this->resources = $resources;
$this->pageSize = $pageSize;
Expand Down

0 comments on commit 6427d28

Please sign in to comment.