-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
AuditReaderInterface.php
67 lines (59 loc) · 1.7 KB
/
AuditReaderInterface.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Model;
/**
* @author Thomas Rabaix <[email protected]>
*
* @phpstan-template T of object
*/
interface AuditReaderInterface
{
/**
* @param int|string $id
* @param int|string $revisionId
*
* @phpstan-param class-string<T> $className
* @phpstan-return T|null
*/
public function find(string $className, $id, $revisionId): ?object;
/**
* NEXT_MAJOR: Change the default limit value to `null` and change the native type to `?int`.
*
* @return Revision[]
*
* @phpstan-param class-string<T> $className
*/
public function findRevisionHistory(string $className, int $limit = 20, int $offset = 0): array;
/**
* @param int|string $revisionId
*
* @phpstan-param class-string<T> $className
*/
public function findRevision(string $className, $revisionId): ?Revision;
/**
* @param int|string $id
*
* @return Revision[]
*
* @phpstan-param class-string<T> $className
*/
public function findRevisions(string $className, $id): array;
/**
* @param int|string $id
* @param int|string $oldRevisionId
* @param int|string $newRevisionId
*
* @return array<string, array{old: mixed, new: mixed, same: mixed}>
*
* @phpstan-param class-string<T> $className
*/
public function diff(string $className, $id, $oldRevisionId, $newRevisionId): array;
}