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

Allow custom date range for order type PTK #193

Closed

Conversation

linushstge
Copy link
Contributor

@linushstge linushstge commented Jun 2, 2024

Sometimes its necessary to fetch older logs which may already fetched in a previous request. With this improvement the PTK order type supports custom date ranges.

Examples:

// Default: Fetch logs since last fetch
$ptk = $this->client->PTK();

// Fetch logs from -3 hours to now
$ptk = $this->client->PTK(Carbon::now()->subHours(3));

// Fetch logs from -24 hours to -12 hours
$ptk = $this->client->PTK(Carbon::now()->subHours(24), Carbon::now()->subHours(12));

// Fetch logs from yesterday
$ptk = $this->client->PTK(Carbon::now()->subDay()->startOfDay(), Carbon::now()->subDay()->endOfDay());

return $ptk->getData();

@@ -375,16 +375,21 @@ function ($segmentNumber, $isLastSegment) use ($dateTime) {
* @inheritDoc
* @throws Exceptions\EbicsException
*/
public function PTK(DateTimeInterface $dateTime = null): DownloadOrderResult
{
public function PTK(
Copy link
Member

Choose a reason for hiding this comment

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

I think that here is another naming.

This naming was before.

   DateTimeInterface $dateTime = null,
        DateTimeInterface $startDateTime = null,
        DateTimeInterface $endDateTime = null

And tests not updated.

@andrew-svirin
Copy link
Member

Merged.

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