-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathResourceCollectionInterface.php
More file actions
67 lines (57 loc) · 1.63 KB
/
ResourceCollectionInterface.php
File metadata and controls
67 lines (57 loc) · 1.63 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
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);
namespace Enm\JsonApi\Model\Resource;
use Enm\JsonApi\Model\Common\CollectionInterface;
/**
* @author Philipp Marien <marien@eosnewmedia.de>
*/
interface ResourceCollectionInterface extends CollectionInterface
{
/**
* @return ResourceInterface[]
*/
public function all(): array;
/**
* @param string $type
* @param string $id
*
* @return bool
*/
public function has(string $type, string $id): bool;
/**
* @param string $type
* @param string $id
*
* @return ResourceInterface
*/
public function get(string $type, string $id): ResourceInterface;
/**
* @param string $type
* @return ResourceInterface
*/
public function first(string $type = null): ResourceInterface;
/**
* @param ResourceInterface $resource
*
* @return ResourceCollectionInterface
*/
public function set(ResourceInterface $resource): ResourceCollectionInterface;
/**
* @param ResourceInterface $resource
* @param bool $replaceExistingValues
* @return ResourceCollectionInterface
*/
public function merge(ResourceInterface $resource, bool $replaceExistingValues = false): ResourceCollectionInterface;
/**
* @param string $type
* @param string $id
* @return ResourceCollectionInterface
*/
public function remove(string $type, string $id): ResourceCollectionInterface;
/**
* @param ResourceInterface $resource
*
* @return ResourceCollectionInterface
*/
public function removeElement(ResourceInterface $resource): ResourceCollectionInterface;
}