SegmentRepository.php
1.03 KB
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
<?php
declare(strict_types=1);
namespace ACP\Search;
use AC\Type\ListScreenId;
use ACP\Exception\FailedToSaveSegmentException;
use ACP\Search\Entity\Segment;
use ACP\Search\SegmentRepository\Sort;
use ACP\Search\Type\SegmentKey;
interface SegmentRepository
{
public function generate_key(): SegmentKey;
public function find(SegmentKey $key): ?Segment;
public function find_all(ListScreenId $list_screen_id = null, Sort $sort = null): SegmentCollection;
public function find_all_by_user(
int $user_id,
ListScreenId $list_screen_id = null,
Sort $sort = null
): SegmentCollection;
public function find_all_global(ListScreenId $list_screen_id = null, Sort $sort = null): SegmentCollection;
/**
* @throws FailedToSaveSegmentException
*/
public function create(
SegmentKey $segment_key,
ListScreenId $list_screen_id,
string $name,
array $url_parameters,
int $user_id = null
): Segment;
public function delete(SegmentKey $key): void;
}