-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathResourceInterface.php
53 lines (44 loc) · 1.25 KB
/
ResourceInterface.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
<?php
declare(strict_types=1);
namespace Enm\JsonApi\Model\Resource;
use Enm\JsonApi\Model\Common\KeyValueCollectionInterface;
use Enm\JsonApi\Model\Resource\Link\LinkCollectionInterface;
use Enm\JsonApi\Model\Resource\Relationship\RelationshipCollectionInterface;
/**
* @author Philipp Marien <[email protected]>
*/
interface ResourceInterface
{
/**
* @return string
*/
public function type(): string;
/**
* @return string
*/
public function id(): string;
/**
* @return KeyValueCollectionInterface
*/
public function attributes(): KeyValueCollectionInterface;
/**
* @return RelationshipCollectionInterface
*/
public function relationships(): RelationshipCollectionInterface;
/**
* @return LinkCollectionInterface
*/
public function links(): LinkCollectionInterface;
/**
* @return KeyValueCollectionInterface
*/
public function metaInformation(): KeyValueCollectionInterface;
/**
* Creates a new resource containing all data from the current one.
* If set, the new resource will have the given id.
*
* @param string $id
* @return ResourceInterface
*/
public function duplicate(string $id = null): ResourceInterface;
}