| 1 |
<?php |
| 2 |
/** |
| 3 |
* Interface ILogger |
| 4 |
* |
| 5 |
* @package Packetery\Log |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace Packetery\Core\Log; |
| 11 |
|
| 12 |
/** |
| 13 |
* Interface ILogger |
| 14 |
* |
| 15 |
* @package Packetery\Log |
| 16 |
*/ |
| 17 |
interface ILogger { |
| 18 |
/** |
| 19 |
* Adds log record. |
| 20 |
* |
| 21 |
* @param Record $record Record. |
| 22 |
* @return int|false The number of rows inserted, or false on error. |
| 23 |
*/ |
| 24 |
public function add( Record $record ); |
| 25 |
|
| 26 |
/** |
| 27 |
* Get logs. |
| 28 |
* |
| 29 |
* @param int|null $orderId Order ID. |
| 30 |
* @param string|null $action Action. |
| 31 |
* @param array<string, string> $sorting Sorting config. |
| 32 |
* @param int $limit Limit. |
| 33 |
* |
| 34 |
* @return iterable<Record> |
| 35 |
*/ |
| 36 |
public function getRecords( ?int $orderId, ?string $action, array $sorting = [], int $limit = 100 ): iterable; |
| 37 |
|
| 38 |
/** |
| 39 |
* Counts records. |
| 40 |
* |
| 41 |
* @param int|null $orderId Order ID. |
| 42 |
* @param string|null $action Action. |
| 43 |
* |
| 44 |
* @return int |
| 45 |
*/ |
| 46 |
public function countRecords( ?int $orderId = null, ?string $action = null ): int; |
| 47 |
} |
| 48 |
|