-
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathQueryAdapterInterface.php
More file actions
34 lines (29 loc) · 946 Bytes
/
QueryAdapterInterface.php
File metadata and controls
34 lines (29 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
namespace Workflow\Domain\Contracts;
use Illuminate\Support\Collection;
use Workflow\Models\StoredWorkflow;
/**
* Interface for handling database-specific query operations.
*
* Different databases may require different query strategies for optimal performance
* (e.g., MongoDB may need manual filtering in PHP for certain queries).
*/
interface QueryAdapterInterface
{
/**
* Get signals for a workflow, optionally filtered by a maximum created_at timestamp.
*/
public function getSignalsUpToTimestamp(
StoredWorkflow $workflow,
?\Illuminate\Support\Carbon $maxCreatedAt = null
): Collection;
/**
* Get signals between two timestamps.
*/
public function getSignalsBetweenTimestamps(
StoredWorkflow $workflow,
\Illuminate\Support\Carbon $afterTimestamp,
?\Illuminate\Support\Carbon $beforeTimestamp = null
): Collection;
}